POST /monsters/find
: list all monstersPOST /monsters
: create a new monsterGET /monsters/:slug
: get details of a specific monster by slugPATCH /monsters/:slug
: update a specific monster by slugDELETE /monsters/:slug
: delete a specific monster by slug
GET /monsters
: list all monsters with name and imageGET /monsters/:id
: get details of a specific monsterPATCH /monsters/:id/captured
: mark a specific monster as captured
POST /monsters/find
: search monsters by name and filter by type using body, which in the payload can define sort and filter
POST /signup
: create a new user accountPOST /login
: authenticate a user and retrieve an access token
- Recommended: Use nvm v16
- Copy
.env.example
to.env
and change accordingy - Run
npm install
- Run
npm run start
- Copy
.env.test.example
to.env.test
- Run
npm run test
-
Haven't started for the captured API yet.
-
Haven't finished the sort.
-
I'm using mongodb because of it's:
- Scalability: Mongodb is designed for scaling horizontally, which means it can handle more traffic and more data, different to mysql, which is more designed vertically
- Easier to implement / Flexible: Due to using document based storage, when there are some change in the schema, it is not really hard to sync it.
- Performance: Mongodb has a built in support for sharding and replication, hence improving performance and redundancy.