0.6.4 • Published 3 months ago

dino-serverless v0.6.4

Weekly downloads
2
License
Apache-2.0
Repository
gitlab
Last release
3 months ago

DinO Serverless

DinO Serverless's aim is to create a configuration first framework for exposing web APIs in a serverless architectural configuration. The basic idea is that the first step of development starts with defining your Swagger/OpenAPI definition and provide it to DinO Serverless which will map your API and connect directly your code using the standard operationId defined for each API, this allow you to focus on your business requirements and the aspects that matters for your application leaving the boilerplate to DinO Serverless.

In order to be able to connect your Swagger/OpenAPI definition with your code seemlesly DinO Serverless define the concept of Interface, an interface is a Component on DinO world which responsibility is to accept the input from the users and propagate, after the required checks are performed, it to your services.

An example of how DinO Serverless works is provided on the examples/json folder, you can run it using the following command:

DINO_CONTEXT_ROOT=examples/json DINO_CONFIG_PATH=examples/json/config.json node examples/json/main.js

DinO Serverless integrate with Swagger UI, this allow you to easilly test your APIs and provide a clear interface for documentation, the Swagger UI will ba accessible at http://localhost:3030/api-docs or in general https://hostname:port/api-docs.

Configuration

API configuration is primarily done via OpenAPI 3.0 definition. Some aspects are configured via a configuration file.

Monitoring

If enabled an additional endpoint /monitor is exposed that provides usefull information about the application status.

Exposed information are:

  1. UP/DOWN status
  2. Per-API cache - when enabled - information
  3. CO2eq runtime emissions if enabled via the dino.server.monitoring.co2 configuration. CO2eq monitoring is executed using the CO2.js library provided by The Greeen Web Foundation

Monitoring is enabled by default and can be controlled enabled/disabled using the dino.server.monitoring.enabled configuration.

Example

{
  "dino": {
    "monitoring": {
      "enabled": true|false,
      "c02": true|false
    }
  }
}

Caching

Dino-express uses apicache-plus module to provide caching functionalities. Caching is enabled adding the cache directive as part of the API definition, available configuration aspects are:

ParameterDescriptionDefault
ttlThe TTL of the cache for this API30 minutes
debugEnable debug statements for on consolefalse
trackPerformanceEnable performance tracking for the API cache, performance monitoring can be observed via /monitor endpointtrue
isBypassableAllows to bypass cache by requesting with Cache-Control: no-store headertrue

Example

---
paths:
  /uuid:
    get:
      summary: Get a UUID
      operationId: getUUID
      tags:
        - uuid
      parameters: {}
      cache:
        ttl: 30 Seconds
        debug: false
        trackPerformance: true
        isBypassable: true
      responses:
        '200':
          description: An object containing a UUID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UUID'
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'

Contributing

Given the scarce amount of time in my hands the pace of the project is really slow, so contribution are welcome.

If you are interested in contributing to the project please do not hesitate have a look at the contributing guidelines or get in touch.

0.6.3

3 months ago

0.6.2

3 months ago

0.6.4

3 months ago

0.5.9

3 months ago

0.5.8

3 months ago

0.5.6

9 months ago

0.5.5

9 months ago

0.5.7

9 months ago

0.5.1

11 months ago

0.4.4

1 year ago

0.4.6

1 year ago

0.4.3

1 year ago

0.4.2

1 year ago

0.2.21

1 year ago

0.3.0

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago

0.2.20

1 year ago

0.2.17

1 year ago

0.2.16

1 year ago

0.2.15

1 year ago

0.2.14

2 years ago

0.2.13

2 years ago

0.2.12

2 years ago

0.2.11

2 years ago

0.2.10

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.1.12

3 years ago

0.1.13

3 years ago

0.1.14

3 years ago

0.1.16

3 years ago

0.1.10

3 years ago

0.1.11

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.4

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.3

3 years ago

0.1.0

3 years ago

0.0.28

3 years ago

0.0.25

3 years ago

0.0.26

3 years ago

0.0.27

3 years ago

0.0.24

3 years ago

0.0.23

4 years ago

0.0.22

4 years ago

0.0.21

4 years ago

0.0.20

4 years ago

0.0.19

4 years ago

0.0.18

4 years ago

0.0.17

4 years ago

0.0.16

4 years ago

0.0.15

4 years ago

0.0.14

4 years ago

0.0.10

4 years ago

0.0.11

4 years ago

0.0.12

4 years ago

0.0.13

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.6

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago