Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

AbdouB/favorite-ads-rest-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a simple dockernized API using go + mongodb

After cloning the repo run the following commands to get up and running:

  • docker-compose up -d --build

  • docker-compose up

the server should be listening on port 3000

API endpoints

METHOD / ENDPOINT PARAMS RESPONSE
GET /users NONE Will return an array of pre-seeded users:
[{_id: xxxx, email: xxx}, {},...]
GET /ads NONE Will return an array of pre-seeded ads:
[{_id: xxxx, title: xxx, description: xxxx}, {},...]
GET /user/{user_id}/favoriteads/{save_type} user_id: 24 char hex (required)
save_type: manual | automatic | all (required)
array of user favorite ads: [{_id: xxxx, title: xxx, description: xxxx, saveType: xxx}, {},...]
POST /user/favoriteads adId: 24 char hex (required)
userId: 24 char hex (required)
saveType: manual | automatic (optional: will be replaced by "automatic" if another or no value is specified)
array of updated favorite ads:
[{_id: xxxx, title: xxx, description: xxxx, saveType: xxx}, {},...]
DELETE /user/favoriteads adId: 24 char hex (required)
userId: 24 char hex (required)
array of updated favorite ads:
[{_id: xxxx, title: xxx, description: xxxx, saveType: xxx}, {},...]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages