From f4bccca90bd1ef762a3d7be18c149f5343fbc5a7 Mon Sep 17 00:00:00 2001 From: ctjong Date: Sun, 6 Jan 2019 12:12:28 -0800 Subject: [PATCH] readme fix 2 --- Readme.md | 83 ++++++++++++++++++++++++++++++++++++++++- core/package.json | 2 +- docs/sample-blog-app.md | 2 +- 3 files changed, 84 insertions(+), 3 deletions(-) diff --git a/Readme.md b/Readme.md index bc7c1d8..dac2d70 100644 --- a/Readme.md +++ b/Readme.md @@ -4,4 +4,85 @@ 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](https://github.com/expressjs/express). The server application that the framework creates will support CRUD, file upload, authentication, and error handling. -See [the framework's documentation](https://ctjong.github.io/orion) for more details. \ No newline at end of file +## 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 + +```bash +$ npm install --save orion-api +``` + +## Example usage + +**config.js** + +```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** + +```js +const Orion = require('orion-api'); +const config = require('./config'); +const orionApp = new Orion.App(config); +orionApp.setupApiEndpoints(); + +// to add more endpoints, use orionApp.app like regular Express app: +// orionApp.app.get("/additionalroute", (req, res) => ...); + +orionApp.startAsync(); +``` + +## Documentation + +- [Home](https://ctjong.github.io/orion) +- [Sample Blog App](https://ctjong.github.io/orion/docs/sample-blog-app) +- [API Endpoints](https://ctjong.github.io/orion/docs/api-endpoints) +- [Configuration Options](https://ctjong.github.io/orion/docs/configuration-options) +- [Sample Configuration](https://ctjong.github.io/orion/docs/sample-configuration) +- [Authentication](https://ctjong.github.io/orion/docs/authentication) +- [User Roles](https://ctjong.github.io/orion/docs/user-roles) +- [Condition Syntax](https://ctjong.github.io/orion/docs/condition-syntax) +- [API Reference](https://ctjong.github.io/orion/docs/api-reference) + + +## Links + +[Contributing](https://github.com/ctjong/orion/tree/master/CONTRIBUTING.md) + +[License](https://github.com/ctjong/orion/tree/master/LICENSE) \ No newline at end of file diff --git a/core/package.json b/core/package.json index d4e2f0e..6cff1db 100644 --- a/core/package.json +++ b/core/package.json @@ -1,6 +1,6 @@ { "name": "orion-api", - "version": "2.0.1", + "version": "2.0.2", "description": "Config based REST API framework", "main": "build/index.js", "repository": { diff --git a/docs/sample-blog-app.md b/docs/sample-blog-app.md index d24b6a8..1db801a 100644 --- a/docs/sample-blog-app.md +++ b/docs/sample-blog-app.md @@ -56,7 +56,7 @@ To see what the framework can do, let us try creating a simple API server. Here ```js const Orion = require('orion-api'); const config = require('./config'); - const orionApp = new Orion(config); + const orionApp = new Orion.App(config); orionApp.setupApiEndpoints(); // You can add more endpoints to the orionApp.app object or do other things here