DEV Community

Can Mingir for Nucleoid

Posted on

4 2

OpenAPI Integration

Similar to building on Express.js, you can also build the same APIs with OpenAPI. There is only one additional field x-nuc-action that is triggered when the API has been called, which run the action function inside the Nucleoid runtime.

POST https://localhost:8448/openapi

{
  "api": {
    "/": {
      "get": {
        "summary": "Hello World",
        "description": "Hello World",
        "params": [
          {
            "name": "example",
            "in": "query",
            "type": "string",
            "required": false,
            "description": "example"
          }
        ],
        "request": {
          "type": "object",
          "properties": {}
        },
        "response": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            }
          }
        },
        "x-nuc-action": "function action(req) { return { message: 'Hello World' }; }"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay