Skip to content

Commit

Permalink
readme fix 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ctjong committed Jan 6, 2019
1 parent bc30f7b commit f4bccca
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 3 deletions.
83 changes: 82 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
## 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)
2 changes: 1 addition & 1 deletion core/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion docs/sample-blog-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f4bccca

Please sign in to comment.