const express = require('express');

      Javascript language logoInitialize Express Js

      const app = express(); app.use('/', express.static(__dirname)); app.use('/logs', express.logger()); app.listen(3000, () => { console.log('Express server started on port 3000'); });

      In the above code, we are setting up Express and creating an app instance. Next we are using several provisions, one of which is the use directive which tells Express to use the / route. We then use the Express logger module and specify that we want to use it for all logs entries. Finally, we specify that our app should be listening on port 3000.

      Shortcut: express.init

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.