This project was created with Node.js using Express, mongoDB and socket.io.
-
Create a
.envfile using.env.examplefor reference. Fill in the values as required. -
Clone the project:
git clone <project-repository-url> -
Install dependencies:
npm i -
Start the development server:
npm run server
| Method | Route | Description |
|---|---|---|
| GET | /auth/user | Fetch user data with the given user id |
| POST | /auth | Authenticate user with the given username and password |
| Method | Route | Description |
|---|---|---|
| GET | /users/:username | Fetch user data with the given username |
| POST | /users | Create new user (secret key required) |
| PUT | /users/:username | Update user (pending) |
| DELETE | /users/:username | Delete user (pending) |
| Method | Route | Description |
|---|---|---|
| GET | /events | Fetch events |
| GET | /events/find | Fetch events with a matching event code |
| GET | /events/:id | Fetch events with a matching id |
| POST | /events | Create new event |
| PUT | /events/:id | Update event (pending) |
| DELETE | /events/:id | Delete event (pending) |
| Method | Route | Description |
|---|---|---|
| GET | /events/:event/questions | Fetch questions for the given event |
| POST | /events/:event/questions | Create new question |
| PUT | /questions/:eventcode | Update event (pending) |
| DELETE | /questions/:eventcode | Delete event (pending) |
-
Add functionality for the
updateanddeletecontrollers for the different resources -
Add functionality to emit events for
update_questionanddelete_questionto the respective routes -
Add functionality to log events emitted by
socket.io -
Add a Dockerfile and build Docker image
In the project directory, you can run:
Runs the server in the development mode.
Open http://localhost:5000 to view it in the browser.
Runs the server in the development mode.
Open http://localhost:5000 to view it in the browser.
The server will reload if you make edits.