A RESTful API built with Node.js, Express, TypeScript, and MongoDB. It provides endpoints to manage Users and Events. It's designed to serve data to a front-end application where the rendering happens.
- Node.js
- Express.js
- TypeScript
- MongoDB (with Mongoose)
- Node.js
- MongoDB instance (local or cloud)
Clone the repository:
git clone https://github.com/anpythomas/em-app-ts
Install the dependencies:
npm install
Create a .env file in the root directory and set the following variables:
DB_STRING=<your_mongodb_connection_string>
PORT=<port_to_run_the_server_on>
GET /users Fetch all users
GET /users/:id Fetch a single user by id
POST /users Create a new user
GET / Fetch all events
GET /events/:id Fetch a single event by id
POST /events Create a new event
PUT /events/:id Update an existing event
DELETE /events/:id Delete an event
To run the project locally, use:
npm start