A Express.js plugin for Bauta.js.
npm install @axa/bautajs-express
const express = require('express');
const { BautaJSExpress } = require('@axa/express');
const apiDefinition = require('../../api-definition.json');
const app = express();
const bautaJSExpress = new BautaJSExpress({ apiDefinition });
const router = await bautaJSExpress.buildRouter();
app.use('/v1', router);
app.listen(3000, err => {
if (err) throw err;
console.info('Server listening on localhost: 3000');
});
See a full example on Example of a project from scratch.
Fastify has an out-of-the-box request validation, therefore the builtin Bauta.js request validations are disabled on this plugin.
Copyright (c) AXA Group. All rights reserved. Licensed under the (MIT / Apache 2.0) License.
- @axa/bautajs-core@1.0.0 - MIT*
- compression@1.7.4 - MIT
- cors@2.8.5 - MIT
- express@4.18.1 - MIT
- express-pino-logger@7.0.0 - MIT
- helmet@5.1.0 - MIT
- openapi-types@12.0.0 - MIT
- pino@8.4.2 - MIT
- route-order@0.1.0 - MIT
- swagger-ui-express@4.4.0 - MIT