Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/t2ny/f1drivers-api

A RESTful API built with NodeJS and MongoDB exposes endpoints to retrieve F1 drivers information
https://github.com/t2ny/f1drivers-api

expressjs mongodb mongoosejs nodejs odm rest-api restful services

Last synced: 6 days ago
JSON representation

A RESTful API built with NodeJS and MongoDB exposes endpoints to retrieve F1 drivers information

Awesome Lists containing this project

README

        

# F1 Drivers REST API

### Introduction

This REST API was built as a hobby project so that users can get F1 drivers information.

### F1 Drivers REST API Features (updated as new features are added)

- Users can get all drivers.
- Users can search for a driver by name.

### Installation Guide (If you want to run locally)

- Fork and clone the repository [here](https://github.com/t2ny/F1Drivers-API).
- 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=` and `MONGODB=` keys.
- Add your `PORT` number and `MONGODB` connection string.

### Usage (Local)

- Run `npm run dev` to start the application.
- Connect to the API using any REST client (Postman, Insomnia...) of your choice.

### Usage (Service)

- Run `npm run dev` to start the application.

### API Endpoints

| 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 |

### Technologies Used

- [NodeJS](https://nodejs.org/) This is a cross-platform runtime environment built on Chrome's V8 JavaScript engine used in running JavaScript codes on the server.
- [ExpressJS](https://www.expresjs.org/) This is a NodeJS web application framework.
- [MongoDB](https://www.mongodb.com/) This is a free open source NOSQL document database with scalability and flexibility. Data are stored in flexible JSON-like documents.
- [Mongoose ODM](https://mongoosejs.com/) This makes it easier to work with non-relational data by creating a schema of our models.

### Authors

- [t2ny](https://github.com/t2ny)