GithubHelp home page GithubHelp logo

dipankarpaul2k / items-api-fastify Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 21 KB

Node.js API with Fastify - Learn CRUD operations with a simple API powered by ChatGPT-generated fake data.

JavaScript 100.00%

items-api-fastify's Introduction

Items API using Fastify ๐Ÿ˜Š

I am learning about APIs and CURD operations.This is the second time I am buildin an API. This is a simple API using nodejs and fastify framework. I have used a fake data created by ChatGPT to build this API.

Table of Contents ๐Ÿ‘‡

  1. Documentation
  2. Installation & Usage
  3. Endpoints
  4. Dependencies
  5. Author

Documentation

I have used fasify-openapi-docs plugin to generate docs autometically.

localhost:5000/docs/

Installation & Usage

  • Fork the repository in your account in Github.
  • Make project directory and go inside the directory.
  • Clone the repository.
  • Install dependencies.
  • Start or run your API on the local machine.
  • Access the API in your browser or tools like Postman. I have used Rest Client VS Code extension.
# Make a directory
mkdir items-api-fastify

# go inside the directory
cd items-api-fastify

# Clone the repo
git clone https://github.com/...(repo url)

# Install dependencies
npm install

# Start the API
npm start

# Access the API in your web browser
http://localhost:5000/items

Endpoints

GET method

# To get all the items
localhost:5000/items

# To get a single item
localhost:5000/items/:itemId

POST method

# To add a new item
localhost:5000/items

PUT method

# To update a single item
localhost:5000/items/:itemId

DELETE method

# To delete a single item
localhost:5000/items/:itemId

Dependencies

Here are some of the major dependencies used in this project:

  • Fastify: [^4.23.2]
  • fastify-openapi-docs: [^2.2.1]
  • nanoid: [^5.0.1]
  • nodemon: [^3.0.1]
  • pino-pretty: [^10.2.3]

Author

Dipankar Paul ๐Ÿ˜€ | ๐Ÿ‘‰ [email protected] ๐Ÿ˜Š

items-api-fastify's People

Contributors

iamdipankarpaul avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.