Code Monkey home page Code Monkey logo

toyserver's Introduction

ToyServer Express.js API

This repository contains a simple Express.js server that provides API endpoints to manage toys. The server is hosted on Vercel and can be accessed at https://toyserver.vercel.app.

API Endpoints

The following API endpoints are available:

GET /toys: Get all toys data.
GET /toys/:id: Get a toy by its ID.
DELETE /toys/:id: Delete a toy by its ID.
POST /addtoys: Add a new toy.
GET /sellerlist/:email: Get all toys data by seller's email.
GET /category/:categoryName: Get all toys data by category.

Dependencies

The following dependencies are used in this project:

  • cors (version 2.8.5)
  • dotenv (version 16.0.3)
  • express (version 4.18.2)
  • jsonwebtoken (version 9.0.0)
  • mongodb (version 5.5.0)

Running the Server

To run the server locally, follow these steps:

  1. Clone this repository: git clone https://github.com/programming-hero-web-course-4/b7a11-toy-marketplace-server-side-shadikur.git
  2. Install the dependencies: npm install
  3. Start the server: npm start
  4. The server will be running on http://localhost:5008.

Environment Variables

The following environment variables are used in the project:

  • PORT: The port on which the server runs (default: 5008).
  • MONGODB_URI: The MongoDB connection URI.
  • JWT_SECRET: The secret key used for JSON Web Token (JWT) authentication.

Make sure to set these environment variables when running the server locally or deploying it to a hosting platform.

Help & Questions?

Feel free to explore the code and use it as a starting point for your own Express.js server to manage toys. If you have any questions or suggestions, please open an issue or reach out to the repository owner.

toyserver's People

Contributors

shadikur 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.