Git Product home page Git Product logo

express-template's Introduction

express-template

express + mongodb/mysql Web-Restful开发模板项目

使用

如果没有yarn,请先安装

  1. 安装依赖
yarn install
  1. 开发环境运行
yarn dev
  1. 生产环境运行
yarn start
  1. 格式化代码
yarn lint
  1. 跑测试
yarn test

目录介绍

src
├── app.js              # 应用入口文件
├── config              # 存放各种配置信息文件
│   └── index.js
│
├── constants           # 常量
│   └── index.js
│
│
├── db                  # 数据库相关
│   ├── modules         # 对数据的各种直接操作
│   │   └── userDb.js   
│   │
│   ├── mongodb.js      # 封装mongodb的基本操作
│   └── mysql.js        # 封装mysql的基本操作
│
│
├── routes              # 路由
│   ├── index.js        # 对外统一暴露
│   └── modules         # 各个模块子路由
│       ├── demo.js
│       └── test.js
└── utils               # 工具方法

yarn简单使用

  1. 安装
npm install --global yarn
  1. 查看源地址
yarn config get registry
  1. 切换taobao源
yarn config set registry https://registry.npm.taobao.org/
  1. 安装全部依赖
yarn install
# or
yarn
  1. 添加包
# 开发环境依赖
yarn add <packageName> --dev

# 生产环境依赖
yarn add <packageName> --save
  1. 移除包
yarn remove <packageName>

express-template's People

Contributors

atqq avatar cacolet avatar

Stargazers

 avatar  avatar  avatar

Watchers

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