JSPM

  • Created
  • Published
  • Downloads 109
  • Score
    100M100P100Q85202F
  • License MIT

Query plugin for routup.

Package Exports

  • @routup/query
  • @routup/query/package.json

Readme

@routup/query

npm version main codecov Known Vulnerabilities Conventional Commits

This is a plugin for reading and parsing the query string of the request url.

Table of Contents

Installation

npm install @routup/query --save

Documentation

To read the docs, visit https://routup.net

Usage

It is important to invoke the request middleware, to parse the query-string of the request url.

import { Router, send } from 'routup';
import {
    createHandler,
    useRequestQuery
} from '@routup/query';

const router = new Router();

router.use(createHandler());

router.get('/', (req, res) => {
    const query = useRequestQuery(req);
    console.log(query);
    // { key: ..., ... }

    send(res, query);
});

router.listen(3000);

License

Made with 💚

Published under MIT License.