Giter VIP home page Giter VIP logo

ts-koa-starter's Introduction

本人平常喜欢用nodejs瞎 JB 写写东西,但是每次都要创建项目、安装依赖等等前戏工作,这让我很烦。于是乎写了个空的起手式,这样以后写东西直接 clone 下来就行了。

我觉得跟我一样的人应该很多,所以也把这个小东西分享给大家。

ts-koa-starter

这是一个koa+typescript的起手式(简单的空环境)

如果你想再加个typeorm来玩玩数据库,请 clone 下来后切换到bt-ts-koa-typeorm分支

ps:typeorm是一个非常好的数据库 ORM,如果你没玩过,请务必尝试一下 💪💪💪

项目结构

.
├── src
│   ├── controller      //controller层
│   ├── service         //service层
│   ├── routes.ts       //路由
│   └── index.ts        //项目入口index.js
├── ecosystem.config.js //pm2配置
├── nodemon.json        //nodemon配置
├── package.json
└── tsconfig.json

使用

打包

  • yarn build 或 npm run build

生产环境启动

  • 生产环境使用 pm2 启动 可以达到负载均衡 执行:yarn pro 或 npm run pro (生产环境端口默认:8080)

友情链接

ts-koa-starter's People

Contributors

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