Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

orion-api

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

orion-api

Config based REST API framework

  • 2.0.3
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

Contributing

License

Keywords

FAQs

Package last updated on 08 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc