How to use the sofa-api.OpenAPI function in sofa-api

To help you get started, we’ve selected a few sofa-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github spacexland / api / src / servers / rest.ts View on Github external
export default (app, { schema, context }) => {
  const openApi = OpenAPI({
    schema,
    info: {
      title: "SpaceX REST API"
    }
  });

  const basePath = "/rest";

  app.use(cors());

  app.use(
    basePath,
    sofa({
      schema,
      context,
      onRoute(info) {

sofa-api

Create REST APIs with GraphQL

MIT
Latest version published 3 days ago

Package Health Score

84 / 100
Full package analysis

Popular sofa-api functions