gaber-elsayed

Simple-Express-app

Apr 3rd, 2021
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. const express = require('express') ;
  2. const app = express();
  3.  
  4.  
  5. app.get('/' , (req, res)=>{
  6. console.log("[INFO]: You are now in.") ;
  7. res.setHeader('type' , 'text/html') // If you wanna remove the html text's remove the res.setheader and continue with your code.
  8. res.send('<h1>Welcome to my express app from express</h1>') ;
  9. })
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16. app.listen(55555); // go to localhost:55555 for it to work when you do node app.js
Advertisement
Add Comment
Please, Sign In to add comment