- very useful for validation
- very useful for testing endpoints
- the framework we are using to create our restful service
- Allows you to refresh the nodejs app with out restarting it!!! (11/10) usefulness!!!!
little thing with example of how to use nodejs
- Systems can used a client/server arch, Client is FE, Server is BE to save data.
- this uses HTTP protocol
- Client can directly enteract with server via http and this is where REST comes into play.
REST - Representational State Transfer
- We use simple http protocols to create, read, update and delete data (CRUD Operations)
- this is an example of a company with a url(endpoint)
first part is the protocol, domain, can include api but it would be the directory what we would be using (the resource)
Standarad Http methods used to interact with server ---->
- GET (getting data)
- POST (creating data)
- PUT (updating data)
- DELETE (deleting data)
So as an example of a GET request ...
we can further this by specifying the data by including customer id such as this
Overall the restful convenstion is this ---
After setting up your app you can upload it to git etc do what ever you want to save it.
we will be using Postgre SQL and heroku to host since they are free.
First make a heroku account its really ez. after you can link your REST API with heroku via ---
and select an addon in resources and pick postgre sql
heroku addons:create heroku-postgresql:hobby-dev
heroku pg:credentials DATABASE
or
heroku pg:credentials:url
then when you get ur url and other detail for the db just link them together and you should get a heroku page
which then if you install postgre sql
and use it to upload tables, etc
Currently Hosted on ThisSite