Package Exports
- exegesis-express
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (exegesis-express) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
exegesis-express
exegesis
n. An explanation or critical interpretation of a text, especially an API definition document.
-- No dictionary ever
This library implements an Express middleware for OpenAPI 3.x.
WARNING
🚨🚨 This is super beta. 🚨🚨
This is very much a work in progress. Wait for the v1.0.0 release, coming soon! :)
Usage
import express from 'express';
import http from 'http';
import * as exegesisExpress from 'exegesis-express';
async function createServer() {
// See https://github.com/exegesis-js/exegesis/blob/master/docs/Options.md
const options {
controllers: path.resolve(__dirname, './integrationSample/controllers'),
securityPlugins: {
sessionKey: sessionAuthSecurityPlugin
}
};
const exegesisMiddleware = await exegesisExpress.middleware(
path.resolve(__dirname, './integrationSample/openapi.yaml'),
options
);
const app = express();
app.use(exegesisMiddleware);
app.use((err, req, res, _next) => {
if(err) {
res.writeHead(500);
res.end(`Internal error: ${err.message}`);
} else {
res.writeHead(404);
res.end();
}
});
const server = http.createServer(app);
server.listen(3000);
}
TODO
- Enable semantic-release
travis env set GH_TOKEN [your token here]
travis env set NPM_TOKEN [your token here]
- Uncomment lines in travis.yml
Copyright 2018 Jason Walton