This is a basic structure for a project management application.
- NodeJS: As an asynchronous event-driven JavaScript runtime, Node.js is designed to build scalable network applications.
- Express: Framework for building web applications on top of NodeJS.
- CRUD: Acronym for Create, Read, Update and Delete. It is set of operation for servers to execute (POST, GET PUT and DELETE).
- UUID: Generator of unique identifiers for objects.
- Query parameters: Are a defined set of parameters attached to the end of a url. They are extensions of the URL that are used to help define specific content or actions based on the data being passed. Making filtering and paging possible.
- JSON: The json() method of the Body mixin takes a Response stream and reads it to completion. It returns a promise that resolves with the result of parsing the body text as JSON.
- Nodemon: Utility that will monitor for any changes in your source and automatically restart your server.
-
Clone this Repository:
$ git clone git@github.com:mouracamila/nodejs-crud.git
-
Installing dependencies:
$ yarn
-
Running project:
$ yarn dev
[nodemon] starting `node src`
🚀 Back-end started!
POST /projects
Name | Type | Required | Description |
---|---|---|---|
title | any | Yes | Project title |
owner | any | Yes | Project owner |
SUCCESS
Code: 200
{
"id": <tokenUUID>,
"title": <any>,
"owner": <any>
}
GET /projects?title=<any>&owner=<any>
Query parameters.
Name | Type | Required | Description |
---|---|---|---|
title | any | Yes | Project title |
owner | any | Yes | Project owner |
SUCCESS
Code: 200
{
"id": <tokenUUID>,
"title": <any>,
"owner": <any>
}
ERROR
Code: 400
{
[]
}
PUT /projects
Name | Type | Required | Description |
---|---|---|---|
token | any | Yes | Token UUID |
SUCCESS
Code: 200
{
"id": <tokenUUID>,
"title": <any>,
"owner": <any>
}
ERROR
Code: 400
{
"error": "Project not found."
}
DELETE /projects
Name | Type | Required | Description |
---|---|---|---|
token | any | Yes | Token UUID |
SUCCESS
Code: 200
[]
ERROR
Code: 400
{
"error": "Project not found."
}
This project is under license from MIT.
with ❤ - MouraCamila