This is an API where you can do the following:
- Log in.
- Sign up.
- Create task
- Read Task
- Update Task
- Delete Task
- Upload an image
- And more...
It also comes with JWT authentication, and it uses SendGrid to send email when you signup or delete your account.
Some of the endpoint are tested with the Jest library.
Before run the API, you should have installed MongoDB in your computer, and configured the following files:
- dev.env
- test.env
Feel free to modify these files with you config or use the default.
PORT=3000
SENDGRID_API_KEY=MySecretApiKey
MONGODB_URL=mongodb://127.0.0.1:27017/todo
JWT_SECRET=secretkey
Attention
: You should use your own SENDGRID_API_KEY, by default all the functions that use the SendGrid API are commented, that way you will not have any error if you don't have the private key 😉.
Use NPM to run the project:
npm install
npm run start
You can also run it using nodemon:
npm run dev
To run all the tests with Jest, use the following command:
npm run test
Here you can use examples of use, using Postman
and more...
npm run test
- ExpressJS Fast, unopinionated, minimalist web framework for Node.js.
- Jest a delightful JavaScript Testing Framework with a focus on simplicity.
- Moongose elegant mongodb object modeling for node.js.
- Sharp High performance Node.js image processing.
- Validator A library of string validators and sanitizers.
- JsonWebToken JsonWebToken implementation for node.js.
- Bcryptjs Optimized bcrypt in plain JavaScript with zero dependencies.
- Multer Middleware for handling "multipart/form-data".
- Nodemon Monitor for any changes in your node.js application and automatically restart the server - perfect for development.
Closures is provided under the MIT License.
MIT License
Copyright (c) 2022 Pértile Franco Giuliano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.