Skip to content

mill6-plat6aux/arbuscular

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


The ultra-lightweight API server 😋


Architecture

Architecture

Setup

Create arbuscular.yaml at the top level of your Node.js project and write the following.

port: 3000
interfaces:
  - contextPath: "example"
    interface: "./open-api.yaml"
    route: "./route.yaml"
    authentication:
      module: "./authentication.js"
      function: "authenticate"
    authorization:
      module: "./authorization.js"
      function: "authorize"
  • open-api.yaml is the OpenAPI definition file in your Node.js project.
    • At least OAuth2 clientCredentials must be defined in components.securitySchemes.
  • route.yaml associates the request URL with the JS module in your Node.js project.
  • authentication.js is the OAuth authentication (client credentials grant) implementation in your Node.js project.
  • authenticate is a function of authentication.js and is the logic that performs authentication.
  • authorization.js is the OAuth authorization implementation in your Node.js project.
  • authorize is a function of authorization.js and is the logic that performs authorization.

route.yaml is defined as follows.

/users:
  GET:
    module: ./logic/users.js
    function: getUsers
  POST:
    module: ./logic/users.js
    function: addUser

Finally, npm install arbuscular in your Node.js project and npx arbuscular will start the API server on the specified port.

License

MIT

Developers

Takuro Okada


© Takuro Okada

About

The ultra-lightweight API server 😋

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors