Skip to content

Commit

Permalink
Добавляет сервер
Browse files Browse the repository at this point in the history
  • Loading branch information
rukivbruki committed Oct 14, 2020
1 parent 2a7f496 commit c140a72
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
// const express = require(`express`);
// const path = require(`path`);
// const PORT = process.env.PORT || 5000;
//
// express()
// .use(express.static(path.join(__dirname, `public`)))
// .set(`views`, path.join(__dirname, `views`))
// .set(`view engine`, `ejs`)
// .get(`/`, (req, res) => res.render(`pages/index`))
// .listen(PORT, () => console.log(`Listening on ${ PORT }`));


const express = require(`express`);
const path = require(`path`);
const PORT = process.env.PORT || 5000;

express()
// .use(express.static(path.join(__dirname, `public`)))
// .set(`views`, path.join(__dirname, `views`))
// .set(`view engine`, `ejs`)
.get(`/`, (req, res) => {
res.append(`content-type`, `text/plain`);
res.append(`X-Author`, `rukivbruki`);
res.append(`Content-Type`, `application/javascript; charset=UTF-8`);
res.append(`Access-Control-Allow-Origin`, [`*`]);
res.send(`rukivbruki`);
})
Expand Down

0 comments on commit c140a72

Please sign in to comment.