Example Multicolour App with Hapi server, Mongo and OAuth.
This example app will connect to your Mongo database server, if you haven't used Mongo before or don't have a server to connect to, please read the Mongo Getting Started documentation to get your own Mongo server up.
If you already have a Mongo server running, following these steps will get your server up and running.
- Update the database configuration to your Mongo connection settings in
config.js
. - Run
npm i
in the terminal to get the dependencies for the app. - To use the auth plugin you'll need a registered app on the service you want to use and to add your configuration to
config.js
, if you want to run without auth, comment out line #14 inapp.js
Running npm start
will start the server up.
Once you get the "Server running at: http://localhost:1811"
message you can view the Swagger docs by visiting http://localhost:1811/docs.
Edit and create blueprints in the content/blueprints
to add/edit/remove endpoints from your API automatically.
To learn more about the structure of these schemas, see the Multicolour blueprint documentation
Read more on the Multicolour wiki
You don't have to, Multicolour uses Waterline as it's ORM and you can switch your database tech per environment, per blueprint, however you like. Below is a list of officially supported adapters:
sails-disk
sails-memory
sails-redis
sails-postgres
sails-mongo
sails-mysql
sails-arango
Simply update the require("sails-mongo")
on line #69 of config.js
and update the connection details.
MIT 2016