Orion API
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
moduleexports = 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 = ;const config = ;const orionApp = config;orionApp; // to add more endpoints, use orionApp.app like regular Express app:// orionApp.app.get("/additionalroute", (req, res) => ...); orionApp;
Documentation
- Home
- Sample Blog App
- API Endpoints
- Configuration Options
- Sample Configuration
- Authentication
- User Roles
- Condition Syntax
- API Reference