Advertisement
Guest User

Untitled

a guest
Dec 8th, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. const express = require('express');
  2. const routes = require('./routes.js');
  3.  
  4. const { PORT = 3000, BASE_PATH } = process.env;
  5. const app = express();
  6.  
  7. const timeLog = (req, res, next) => {
  8. console.log(new Date());
  9. console.log(req.method);
  10. next();
  11. };
  12.  
  13. app.use(timeLog);
  14. app.use('/', routes);
  15.  
  16. app.listen(PORT, () => {
  17. console.log('Ссылка на сервер:');
  18. console.log(BASE_PATH);
  19. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement