π±βπ€ API to display data for almost all characters in Naruto.
Built with :
- ExpressJS
- Mongoose
- MongoDB
-
Clone the Repository
git clone https://github.com/othneildrew/Best-README-Template.git
-
Install packages
yarn install # or npm install
-
Setting
.env
filePORT = 5000 MONGODB_URI = local | cloud
-
Seed data to MongoDB
This process is relatively long depending on your internet connection.yarn seed:json yarn seed:db
-
And run the API
yarn start # or npm start
-
Request
- Method :
GET
- Endpoint :
/api/characters
- URL Params / Query :
q=[string]
: For full-text search (optional)skip=[number]
: For skip/offset data (optional)limit=[number]
: For limiting data (optional)sort=['ASC', 'DESC']
: For sorting data by the name (optional)
- Method :
-
Response
- Success
{ "total": "number", "previous":{ "skip": "number" }, "next":{ "skip": "number" }, "data": [ { "_id": "string", "name": "string", "picture": "string" } ] }
- Success
Thanks...π