Code Monkey home page Code Monkey logo

koa_frame's Introduction

Koa框架的搭建

项目结构

|— controller   // 用于解析用户的输入,处理后返回对应的结果。
|— service      // 用于便携业务的逻辑层,比如连接数据库,调用第三方的接口。
|- errorPage    // http请求的错误的时候,对应的错误响应页面
|- logs         // 项目运用中产生的日志数据
|- middleware   // 中间件集中地,用于编写中间件,并集中调用
|- public       // 用于放置静态的资源
|- views/       // 用于放置模版文件,返回客户端的是视图层
|— routes        // 配置URL路由的规则
|- app.js        // 用于自定义启动时的初始化的工作,比如启动https,调用中间件,启动路由等等。

项目部署

开发环境运行

安装nodemon来帮帮助我们自动重启

部署运行

安装pm2 pm2是一个带有负载均衡功能的Node应用的进程管理器
运行的方法:pm2 start app.js

koa_frame's People

Contributors

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