Code Monkey home page Code Monkey logo

starbucks-joa-back's Introduction

STARBUCKS-BACK

Content

Installation

cd starbucks-joa-back
npm install
npm run dev

Set server environment

.env 파일 생성
MONGODB_CONNECT = "Input your MonggoDB database uri"
DBNAME = "Input your database name"
DB products Schema example
{
  name : "돌체 콜드 브루",
  content: "더 이상의 다른 설명은 필요없는 스타벅스",
  price: 5300,
  name_eng: "Nitro Vanilla Cream",
  kcal: "75",
  protein: "1",
  sat_fat: "2",
  sodium: "20",
  sugars: "10",
  caffeine:"245"
  category: "콜드 브루"
}

swagger-jsdoc

doc 주소: http://localhost:500/docs

API

서버주소 : http://localhost:5000

  1. GET /products
  • 데이터베이스에 존재하는 products의 정보를 반환합니다.(최대 50개)
  • query를 이용한 페이징을 제공합니다.
  • size: 불러올 상품의 숫자(최대 50개), page: 해당 page
  • ex) http://localhost:5000/product?size=10&page=2
    {
      product: [
        {
          _id: "5fe5e5e8b8bfb5285707223a",
          name: "나이트로 바닐라 크림",
          content:
            "부드러운 목넘김의 나이트로 커피와 바닐라 크림의 매력을 한번에 느껴보세요!",
          img: "http://d2xwo4a782qt1n.cloudfront.net/NitroColdBrew.jpg",
          price: 5900,
          name_eng: "Nitro Vanilla Cream",
          kcal: "75",
          protein: "1",
          sat_fat: "2",
          sodium: "20",
          sugars: "10",
          caffeine: "245",
          category:"콜드 브루"
        },
      ],
    };
    
  1. GET /products/:productId
  • 특정 'id'을 가진 product 데이터를 가져옵니다.
    {
    product: {
      _id: "5fe5e5e8b8bfb5285707223a",
      name: "나이트로 바닐라 크림",
      content:
        "부드러운 목넘김의 나이트로 커피와 바닐라 크림의 매력을 한번에 느껴보세요!",
      img: "http://d2xwo4a782qt1n.cloudfront.net/NitroColdBrew.jpg",
      price: 5900,
      name_eng: "Nitro Vanilla Cream",
      kcal: "75",
      protein: "1",
      sat_fat: "2",
      sodium: "20",
      sugars: "10",
      caffeine: "245",
      category:"콜드 브루"
    },
    

};

Skills Server

  • ES2015+
  • Node.js
  • Express
  • MongoDB
  • Mongoose
  • TypeScript
  • Swagger

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.