#live-react-docs
Nodal is a nodejs library paired with a command line interface for building API servers. Another name for this is a microframework. Nodal's aim is to get barriers out of the way so that engineers can build product faster.
| npm install -g nodal | |
| nodal new <my-awesome-project> | |
| cd <my-awesome-project> | |
| nodal g:model <Awesome_Model> <user_id:int body:string json_field:json> | |
| nodal g:controller --for <Awesome-Models> | |
| nodal db:create | |
| nodal db:prepare | |
| nodal db:migrate | |
| nodal s |
| Request: POST to localhost:3000/todos | |
| user_id : 1 | |
| done : false | |
| tasks : {"grapes":"7","bananas":"4","apples":"3"} | |
| Response: | |
| { | |
| "meta": { | |
| "total": 1, |
| npm install -g nodal | |
| nodal new strong_params | |
| npm install -g nodal | |
| nodal new users-access-tokens | |
| cd users-access-tokens | |
| nodal g:model --user | |
| nodal g:controller --for Users | |
| nodal g:model --access_token | |
| nodal g:controller --for Access_tokens | |
| nodal g:model Tweet user_id:int body:string | |
| nodal g:controller --for Tweets | |
| nodal db:create |
| npm install -g nodal | |
| nodal new users-access-tokens | |
| cd users-access-tokens | |
| nodal g:model --user | |
| nodal g:controller --for Users | |
| nodal g:model --access_token | |
| nodal g:controller --for Access_Tokens | |
| nodal db:create | |
| nodal db:prepare | |
| nodal db:migrate |
| nodal new conditional-joins | |
| nodal g:model Tweet user_id:int body:string | |
| nodal g:controller --for Tweets | |
| nodal g:model --user | |
| nodal g:controller --for Users | |
| nodal db:create | |
| nodal db:prepare | |
| nodal db:migrate | |
| nodal s |
| nodal new sensitive-fields | |
| cd sensitive-fields | |
| nodal g:model --user | |
| nodal g:controller --for users | |
| nodal db:create | |
| nodal db:prepare | |
| nodal db:migrate | |
| nodal s |
| //TL;DR: Nodal API server, with users joined to their tweets data | |
| //Make sure you have postgres running. If not, I like postgresapp.com as the fastest way to get set up | |
| //I use Postman to test API endpoints, but you can use whatever you want. | |
| $ npm install -g nodal | |
| $ nodal new tldr-instatweet-api | |
| $ cd tldr-api | |
| $ nodal s | |
| $ nodal g:model Tweet user_id:int body:string | |
| $ nodal g:controller v1 --for Tweets | |
| $ nodal db:create |
| //TL;DR: Nodal API server, with users joined to their tweets data | |
| //Make sure you have postgres running. If not, I like postgresapp.com as the fastest way to get set up | |
| //I use Postman to test API endpoints, but you can use whatever you want. | |
| $ npm install -g nodal | |
| $ nodal new tldr-instatweet-api | |
| $ cd tldr-api | |
| $ nodal s | |
| $ nodal g:model Tweet user_id:int body:string | |
| $ nodal g:controller v1 --for Tweets | |
| $ nodal db:create |