@bapi.js/fastify

0.0.2Β β€’Β PublicΒ β€’Β Published

Bapi Fastify Support v0.0.2 Documentation

πŸš€ A Bapi plugin for building an API with a Fastify server.

Table of Contents

Installation

Install via NPM:

npm i @bapi.js/fastify

Server

Function that handles and creates Fastify server.

Argument Type Description Required
Client Client Client to build server for Yes
Options object Fastify server options No

@Returns fastify(...) (see documentation)

Example

// imports...

const client = bapi();
const server = Server(client);

client.get("test", ctx => {
    return { status: "success" };
});

server.get("/", (req, rep) => {
    rep.send({ message: 'Hello, World!' });
});

server.listen(8080, (err) => {
    if(err) throw err;
    console.log('Server Running!');
});

Dependencies (1)

Dev Dependencies (3)

Package Sidebar

Install

npm i @bapi.js/fastify

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

3.64 kB

Total Files

4

Last publish

Collaborators

  • sawyerbiv