Revisit your terminal window and run your application: This provides us some feedback in the console to know that our application is running. The function passed in as the second parameter is optional and runs when the server starts up. log ( 'Example app is listening on port 3000.' ) ) įinally, once we’ve set up our requests, we must start our server! We are passing 3000 into the listen function, which tells the app which port to listen on. Server.js const express = require ( 'express' ) const app = express ( ) Now that Express is installed, create a new server.js file and open it with your code editor.
0 Comments
Leave a Reply. |