Skip to content

songokjesse/Todo_Api_fastify_mongodb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Todo_Api_fastify_mongodb

TODO API using Fastify with Mongodb for front end developers who dont want any hustle with backend code development

Installation local

---- Requirements ----

  • Node 8.*
  • Npm or yarn
  • MongoDB 10.*

Start your mongodb

$ mongod or sudo mongod

Clone the repository to your machine

 $ git clone https://github.com/songokjesse/Todo_Api_fastify_mongodb.git
 $ cd to Todo_Api_fastify_mongodb

Install dependencies

$ yarn or npm install

create .env file

$ cp .example_env .env

Add your environment variable

 APP_HOST = {your application host}
 APP_PORT = {your application port}
 JWT_SECRET = {your json web token secret}
 MONGO_URL = {your mongodb url e.g 'mongodb://localhost:27017/ApiProjects'}

API Access and use

Use postman to test the api routes e.g

List all tasks (GET)

http://{yourhost:yourport}/api/tasks

create a task (POST)

http://{yourhost:yourport}/api/task

show a task (GET)

http://{yourhost:yourport}/api/task/{id}

Update a task (PUT)

http://{yourhost:yourport}/api/task/{id}

Delete a task (DELETE)

http://{yourhost:yourport}/api/task/{id}

alt text

For swagger documentation, access it on

 http://{yourhost:yourport}/documentation

Installation using Docker

  • Comming Soon

Testing API

  • Comming Soon

The swagger documentation screenshot

alt text