This REST API was built as a hobby project so that users can get F1 drivers information.
- Users can get all drivers.
- Users can search for a driver by name.
- Fork and clone the repository here.
- Run
npm i
to install all required dependencies - You can choose to run MongoDB Atlas cloud or a local MongoDB.
- Create a config folder in the root of the project and add a dev.env file.
- Inside the dev.env file add
PORT=<value>
andMONGODB=<value>
keys. - Add your
PORT
number andMONGODB
connection string.
- Run
npm run dev
to start the application. - Connect to the API using any REST client (Postman, Insomnia...) of your choice.
- Run
npm run dev
to start the application.
HTTP Verbs | Endpoints | Action |
---|---|---|
GET | /api/drivers | To get all drivers |
GET | /api/drivers/search?name=daniel | Get all drivers that matches the name query |
- NodeJS This is a cross-platform runtime environment built on Chrome's V8 JavaScript engine used in running JavaScript codes on the server.
- ExpressJS This is a NodeJS web application framework.
- MongoDB This is a free open source NOSQL document database with scalability and flexibility. Data are stored in flexible JSON-like documents.
- Mongoose ODM This makes it easier to work with non-relational data by creating a schema of our models.