This source is the backend for Write a Robot website (Yet to build) built using nodejs.
- REST API.
- HTTP Basic Auth.
- Mysql Database.
- Node.
- MySql DB. Rest of the dependencies are mentioned in package json file.
Set up environmental variables for the app.
Environment Variable | Value |
---|---|
WAR_DB | MySql DB being used |
WAR_DB_HOST | MySql Host |
WAR_DB_USER | MySql User |
WAR_DB_PASS | MySql Password |
- Create a file users.htpasswd in the root folder of app.
- Create users and associate a password to it in the following format in the users.htpasswd file.
user_name:password
- Make sure the mysql/maria service is started and running.
- Setup the Environment.
- Install all the dependencies.
npm install
- Run the app
npm start
-
Get project details
GET base_url/api/projects GET base_url/api/trainings
Following Query Strings are available
title, tags, category(trainings) limit and offset -
Add new project details
POST base_url/api/projects POST base_url/api/trainings
-
Delete project Details
DELETE base_url/api/projects?title= DELETE base_url/api/trainings?title=
-
Update project Details
PUT base_url/api/projects?title= PUT base_url/api/trainings?title=