1.0.2 • Published 2 years ago

yion-body-parser v1.0.2

Weekly downloads
7
License
MIT
Repository
github
Last release
2 years ago

YION BODY PARSER

A body parser plugin for framework Yion

Install

$ npm install --save yion-body-parser

Usage

const { createServer, createApp } = require('yion');
const bodyParser = require('yion-body-parser');

const app = createApp();
const server = createServer(app, [bodyParser]);

app.post('/file', (req, res) => {
    const file = req.body.file; // file sent with name "file"
    res.sendFile(file.filepath, file.filename, file.mimetype);
});

API reference

File metadata :

  • filename: file name
  • filepath: file temporary path
  • encoding: file encoding
  • mimetype: file MIME type
  • length: file length
  • data: file's data (buffer)
1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.5.0

4 years ago

0.4.3

8 years ago

0.4.2

8 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.0

9 years ago

0.1.0

9 years ago