Server for English for kids app
- Javascript
- Node.js
- Express
- PostgreSQL
- Install Node.js
- Fork this repository: https://github.com/diman17/english-for-kids_server/
- Clone your newly created repo:
https://github.com/<%your_github_username%>/english-for-kids_server/
- Go to folder
english-for-kids_server
- To install all dependencies use
npm install
- Create
.env
file where you need to specify the values of the following variables (database PostgeSQL):PORT
DB_USER
DB_PASSWORD
DB_HOST
DB_PORT
DB_NAME
- Start server
npm start
Get categories
-
URL
/categories
-
Method:
GET
-
Headers:
None
-
URL Params
None
-
Query Params
None
-
Data Params
None
Get category by ID
-
URL
/categories/:id
-
Method:
GET
-
Headers:
None
-
URL Params
id=[integer]
-
Query Params
None
-
Data Params
None
Create category
-
URL
/categories
-
Method:
POST
-
Headers:
'Content-Type': 'application/json'
-
URL Params
None
-
Query Params
None
-
Data Params
{ name: string }
Update category
-
URL
/categories
-
Method:
PUT
-
Headers:
'Content-Type': 'application/json'
-
URL Params
None
-
Query Params
None
-
Data Params
{ id: number, name: string }
Delete category
-
URL
/categories
-
Method:
DELETE
-
Headers:
'Content-Type': 'application/json'
-
URL Params
None
-
Query Params
None
-
Data Params
{ id: number }
Get cards
-
URL
/cards
-
Method:
GET
-
Headers:
None
-
URL Params
None
-
Query Params
None
-
Data Params
None
Get cards by category ID
-
URL
/cards/:id
-
Method:
GET
-
Headers:
None
-
URL Params
id=[integer]
-
Query Params
None
-
Data Params
None
Get card by ID
-
URL
/cards/card/:id
-
Method:
GET
-
Headers:
None
-
URL Params
id=[integer]
-
Query Params
None
-
Data Params
None
Create card
-
URL
/cards
-
Method:
POST
-
Headers:
'Content-Type': 'application/json'
-
URL Params
None
-
Query Params
None
-
Data Params
{ image: string, audio: string, audioName: string, text: string, translate: string, categoryId: number }
Update card
-
URL
/cards
-
Method:
PUT
-
Headers:
'Content-Type': 'application/json'
-
URL Params
None
-
Query Params
None
-
Data Params
{ id: number, image: string, audio: string, audioName: string, text: string, translate: string }
Delete card
-
URL
/cards
-
Method:
DELETE
-
Headers:
'Content-Type': 'application/json'
-
URL Params
None
-
Query Params
None
-
Data Params
{ id: number }