UNPKG

@juniordev/routinejs

Version:

Express inspired, Radix trie based super fast Nodejs router

25 lines (20 loc) 490 B
const Routine = require('../src/router') const axios = require('axios') const app = new Routine({ suppressInitialLog: true, }) const PORT = 1235 const URL = `http://localhost:${PORT}` app.post(`/bodyparse`, (req, res) => { res.json(req.body.name) }) app.listen(PORT) test('post request body parsing', async () => { expect( ( await axios.post(`${URL}/bodyparse`, { name: 'zulfiqar', }) ).data ).toBe('zulfiqar') })