Coder Social home page Coder Social logo

heroku-sails's Introduction

heroku-sails

This is a simple example of getting the new sails.js code running on heroku using mongodb as its database.

"Sails automatically builds a RESTful JSON API for your models. And here's the thing, it supports HTTP and WebSockets. By default, for every controller you create, you get the basic CRUD operations created automatically."

More examples at sails.js.

Setup

Could not be easier to setup your own API server using sails.js, node, mongodb, and heroku.

Short version:

  1. Install sails globally sudo npm install -g sails
  2. Create sails folder sails new heroku-sails
  3. Add to git: cd heroku-sails && git init && git add . && git commit
  4. Look at the git commit history for other changes made - there's only a few

If you have not yet, create heroku account and install heroku toolbelt

Then create a heroku app. I created heroku-sails in the following example:

$ heroku apps:create heroku-sails
Creating heroku-sails... done, region is us
http://heroku-sails.herokuapp.com/ | [email protected]:heroku-sails.git
Git remote heroku added

Add mongo db

$ heroku addons:add mongolab:starter
Adding mongolab:starter on heroku-sails... done, v3 (free)
Welcome to MongoLab.  Your new database is ready for use.  Please consult the MongoLab Add-on Admin UI for more information and useful management tools.
Use `heroku addons:docs mongolab:starter` to view documentation.

Optionally set the api key. If you don't, key check will be skipped and anyone can created/edit. Note that we what you set here is what is sent in URL. For more on this authentication, Read lib/authenKey.js

$ heroku config:set APPROVED_API_KEY=APIKEY
Setting config vars and restarting heroku-sails... done
APPROVED_API_KEY: APIKEY

Optionally add papertrail, lets you view logs from a browser:

$ heroku addons:add papertrail
Adding papertrail on heroku-sails... done, v4 (free)
Welcome to Papertrail. Questions and ideas are welcome. Happy logging!
Use `heroku addons:docs papertrail` to view documentation.

Deploy!

$ git push heroku master

Now view your new app in your browser.

Contact

For questions or custom work, please contact [email protected]

githalytics.com alpha

heroku-sails's People

Contributors

chadn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

heroku-sails's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.