2.0.5 • Published 5 years ago

orion-api v2.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

Orion API

npm npm David

Orion is a framework for creating a config-based REST API server, meaning the client can create a full-fledged API server by only defining a single configuration file. The framework is built on top of Express. The server application that the framework creates will support CRUD, file upload, authentication, and error handling.

Supported components

The framework allows you to use the following services based on your preferences:

  • Database: SQL Server / MySQL / sqlite
  • File storage: Azure Blob Storage / Amazon S3 / Local Server
  • Authentication: Facebook token / Orion JSON Web Token (JWT)
  • Monitoring: Azure Application Insights

Installation

$ npm install --save orion-api

Example usage

config.js

module.exports =
{
    database:
    {
        dialect: "mssql",
        host: _DATABASE_HOST_,
        name: _DATABASE_NAME_,
        userName: _DATABASE_USERNAME_,
        password: _DATABASE_PASSWORD_
    },
    entities:
    {
        "blogpost":
        {
            "fields":
            {
                "title": { type: "string", isEditable: true, isRequired: true, foreignKey: null },
                "content": { type: "richtext", isEditable: true, isRequired: true, foreignKey: null }
            },
            "permissions":
            {
                "read": ["guest"],
                "create": ["guest"],
                "update": ["guest"],
                "delete": ["guest"]
            }
        }
    }
};

server.js

const Orion = require('orion-api');
const config = require('./config');
const orionApp = new Orion(config);
orionApp.setupApiEndpoints();

// to add more endpoints, use orionApp.app like regular Express app:
// orionApp.app.get("/additionalroute", (req, res) => ...);

orionApp.startAsync();

Documentation

Links

Contributing

License

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.2.14

6 years ago

1.2.13

6 years ago

1.2.12

6 years ago

1.2.11

6 years ago

1.2.10

6 years ago

1.2.9

6 years ago

1.2.8

6 years ago

1.2.7

6 years ago

1.2.6

6 years ago

1.2.5

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.10

6 years ago

1.1.9

6 years ago

1.1.8

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.36

6 years ago

1.0.35

6 years ago

1.0.34

6 years ago

1.0.33

6 years ago

1.0.32

6 years ago

1.0.31

6 years ago

1.0.30

6 years ago

1.0.29

6 years ago

1.0.28

6 years ago

1.0.27

6 years ago

1.0.26

6 years ago

1.0.25

6 years ago

1.0.24

6 years ago

1.0.23

6 years ago

1.0.22

6 years ago

1.0.21

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago