0.0.2 ā€¢ Published 3 years ago

@bapi.js/fastify v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Bapi Fastify Support v0.0.2 Documentation

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

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!');
});
0.0.2

3 years ago

0.0.1

3 years ago