Skip to content

axioms-io/sample-node-sails

Repository files navigation

sample-node-sails

Sails.js APIs sample using Axioms and @axioms/express-js. Secure your Sails APIs using Axioms authentication and authorization.

Prerequisite

  • Node v10.16.0+
  • An Axioms client which can obtain access token after user's authentication and authorization and include obtained access token as bearer in Authorization header of all API request sent to Node/Sails application server.

Setup

Clone this repository,

git clone https://github.com/axioms-io/sample-node-sails.git
cd sample-node-sails
npm install

Add Config

Create a .env file and add following configs (see .sample-env),

AXIOMS_DOMAIN=<your-axioms-slug>.axioms.io
AXIOMS_AUDIENCE=<your-axioms-resource-identifier>

Run Dev Server

node app.js --port 5000

Test using Postman

Postman collection is included in this repository. Import the collection in your Postman, setup environment variables host (i.e. localhost:5000) and access_token (you can obtain from your client) and test these APIs.

Documentation

See documentation for express-js.

Deploy to Heroku

You will need to provide Axioms domain and Axioms audience to complete deployment.

Deploy

Edit sample-python-flask