Implementing CRUD Backend infrastructure with underlying in-memory database.
Implementing a CRUD(Create, Read, Update and Delete) backend infrastructure involves creating the fundemental operations necessary for managing data within an application.
Using an in-memory database(mongodb-memory-server) as the underlying storage mechanism means that the data is stored and manipulated within the computer's RAM, rather than being persisted to disk.
In summary, implementing a CRUD backend infrastructure with an in-memory database involves building the necessary functionality to manage data within an application, leveraging the speed and efficiency of storing data in memory for rapid access and manipulation.
To run this project, you will need to add the following environment variables to your .env file
PORT = 4000
A .env.example is provided as well to imitate the .env file.
Navigate to app directory
cd my-project
Run install command for node_modules:
npm install
For Development:
npm run start:dev
For Build:
npm run build
For Production:
npm run start:prod
For Testing:
npm test
For Load Balancer:
npm run start:multi
GET /api/users
Parameter | Type | Description |
---|---|---|
No Parameters |
NA |
NA |
GET /api/users/{userId}
Parameter | Type | Description |
---|---|---|
UserId |
string |
Required |
POST /api/users
Parameter | Type | Description |
---|---|---|
Username |
string |
Required |
Age |
number |
Required |
hobbies |
string[] or Array<string> |
Required |
PUT /api/users/{userId}
Parameter | Type | Description |
---|---|---|
userId |
string |
Required |
DELETE /api/users/{userId}
Parameter | Type | Description |
---|---|---|
userId |
string |
Required |
To run tests, run the following command
npm run test