Giter Site home page Giter Site logo

zdsc-koa2's Introduction

项目说明

基本介绍

介绍中地商城后端通用接口服务,本项目基于node.js以及MongoDB数据开发。

技术栈:koa2+mongoose

主要功能:提供了用户注册登录接口、有关商品、购物车、地址、订单的增删改查接口。

项目目录结构

|-- ZDSC', 									#中地商城
    |-- .env', 								#自定义配置
    |-- .gitignore',
    |-- package-lock.json',
    |-- package.json',
    |-- readme.md', 						#说明文档
    |-- src',
        |-- main.js', 						#入口文件
        |-- app',
        |   |-- errHandler.js', 			#错误处理
        |   |-- index.js', 					#app各项服务
        |-- config',
        |   |-- config.default.js', 		#开启配置
        |-- constant',
        |   |-- err.type.js', 				#定义错误
        |-- controller', 					#路由控件
        |-- db',
        |   |-- index.js', 					#连接数据库
        |-- middleware', 					#路由处理中间件
        |-- model', 						#数据模型
        |-- router', 						#路由
        |-- service', 						#操作数据库  
        |-- upload', #存储上传文件

运行项目

初始准备

安装Git,Node,MongoDB

克隆项目

git clone [email protected]:jiu2021/ZDSC-koa2.git

安装依赖

npm install ...
//生产依赖
"bcryptjs": "^2.4.3",
"dotenv": "^16.0.0",
"jsonwebtoken": "^8.5.1",
"koa": "^2.13.4",
"koa-body": "^4.2.0",
"koa-parameter": "^3.0.1",
"koa-router": "^10.1.1",
"koa-static": "^5.0.0",
"mongoose": "^6.2.4",
"mongoose-delete": "^0.5.4",
npm install nodemon -D
//开发依赖
"nodemon": "^2.0.15"

启动项目

npm run dev
//控制台显示: http://localhost:8000 数据库连接成功……
//则服务已在8000端口启动

调用接口

可使用postman模拟发送http请求,接口地址参考/src/router文件

zdsc-koa2's People

Contributors

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