Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const express = require('express');
- const routes = require('./routes.js');
- const { PORT = 3000, BASE_PATH } = process.env;
- const app = express();
- const timeLog = (req, res, next) => {
- console.log(new Date());
- console.log(req.method);
- next();
- };
- app.use(timeLog);
- app.use('/', routes);
- app.listen(PORT, () => {
- console.log('Ссылка на сервер:');
- console.log(BASE_PATH);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement