Created
February 1, 2018 19:44
-
-
Save vickonrails/8a60eb3b1f8f47d3de493b1966c940d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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