Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.

Latest commit

 

History

History
16 lines (12 loc) · 331 Bytes

File metadata and controls

16 lines (12 loc) · 331 Bytes

Body parsers

Based on body-parser.

JSON

import { createServer, jsonParser } from 'unicore';

createServer()
    .use(jsonParser())
    .use((req, res) => {
        // JSON request payloads are automatically parsed and req.body is set
        res.json(req.body);
    });