Skip to content

Instantly share code, notes, and snippets.

@vickonrails
Created February 1, 2018 19:44
Show Gist options
  • Select an option

  • Save vickonrails/8a60eb3b1f8f47d3de493b1966c940d3 to your computer and use it in GitHub Desktop.

Select an option

Save vickonrails/8a60eb3b1f8f47d3de493b1966c940d3 to your computer and use it in GitHub Desktop.
const express = require('express'),
app = express();
//Different routes
app.get('/users/john',(request,response)=>{
response.send(`John’s page`);
});
app.get('/users/mark',(request,response)=>{
response.send(`John’s page`);
});
app.get('/posts/newpost',(request,response)=>{
response.send(`This is a new post`);
});
app.get('/api',(request,response)=>{
response.send(‘Api endpoint’);
});
app.listen(3000,()=>console.log(‘Server started at port 3000’));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment