Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const express = require('express');
- const app = express();
- const port = 1000;
- const router = express.Router();
- router.use('/superMiddleware', function(req, res, next) {
- console.log('hello middleware');
- next();
- }, function (req, res, next) {
- res.send('hello world');
- next();
- });
- app.listen(port, (err) => {
- if (err) {
- throw new Error('Something bad happened...');
- }
- console.log(`Server is listening on ${port}`);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement