Created
January 19, 2018 17:18
-
-
Save giladno/6847c57c654bac4611ded609fc738847 to your computer and use it in GitHub Desktop.
'route' test on express
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
| 'use strict'; | |
| const express = require('express'); | |
| const axios = require('axios'); | |
| let app = express(); | |
| app.use('/test', (req, res, next)=>next('route'), (req, res)=>res.json({ok: true})); | |
| app.listen(8080, async ()=>{ | |
| let {data} = await axios.get('http://localhost:8080/test'); | |
| console.log(data); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment