Skip to content

Instantly share code, notes, and snippets.

@giladno
Created January 19, 2018 17:18
Show Gist options
  • Save giladno/6847c57c654bac4611ded609fc738847 to your computer and use it in GitHub Desktop.
Save giladno/6847c57c654bac4611ded609fc738847 to your computer and use it in GitHub Desktop.
'route' test on express
'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