This is a backend service built with Node, Express, and Firebase to support a front end client for small artistic merchandising company. This version lacks the credentials to affect the original database but may serve as a templatefor other APIs with firebase.
View Hosted Client here:
If you wish to use the project as a template to create your own project, lease follow:
- Clone this repository
- Open terminal and type
git clone [git link]
- Navigate to project directory using
cd
in terminal - Open project in text editor (atom, VS Code, etc.)
- Type
npm install
in terminal to load node packages - To run the program, run $
npm run start
in terminal - The API will now be locally hosted at localhost:3000
- You can edit the code at this point to be attached to your own backend database. Specifically you'll need to add a firebase.config file.
- The best way to make an API request will be to use a program such as Postman
GET '/posts' Will get all posts
GET '/post/:postId' Will get one post by the ID
DELETE '/post/postId' Will delete a post by the ID
POST '/post/:postId/image' Will post an image to a whichever post ID
POST '/post' Will make a post and the format for the JSON is such: { "name": "Gear of Clarity", "images": "image/path", "link": "https://www.etsy.com/listing/733049738/gear-of-clarity?ref=shop_home_active_3&frs=1", "info": "This intuitive piece was channeled with the intention of pulling uncertainty through the gears of clarity, resulting in resulting in a sense of certainty.", "price": "75", "itemCategory": "painting", "featured": "true", "available": "true", "highEnd": "false" }
You'll need to have node installed
On Mac or Linux terminal issue the commands:
To install Node Version Manager
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
To install the most recent node version
nvm install node
To use that node version
nvm use node
"Now using node v8.2.0 (npm v5.3.0)" should be printed (in whatever version)
Do note that full RESTful functionality was not implemented to to the lack of need for those functions by the client.
- Express - The Routing and performance module used
- Busboy - For multi-part form data uploads
- Firebase - Tools and infrastructure for developing firebase apps
This project is licensed under the MIT License - see the LICENSE.md file for details