npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

safe-start-koa2

v1.0.0

Published

简單武断的 Koa2 的脚手架

Downloads

1

Readme

简單武断的 Koa2 的脚手架

哲学

我不想知道你的哲学,但我想立即开始并完成工作

  • 迅速开发 - 自动热重启服务 + 测试驱动开发模式 + 重置数据库(by cli)
  • 生产就绪 - 有node 和 npm 馬上可以部署,不用安裝任何东西
  • 從眾 - 80%人会做的设计决定(design decision)和80%人会使用的库(library)
  • 结构简單 - routes + MVC + 中间件(Middleware)
  • 没有魔法 - 可由app.js 開始 , 25 分钟读懂的代码

特别之处

  1. 没有babel配置(Node 9)
  2. Nodemon 自动热重启服务
  3. 自帶会员系统 (可拆开)(Passport js)
  4. 邮件服务 (Sparkpost)
  5. 对象关系映射(ORM) (Sequelize)
  6. 多个配置(/.env production.json,test.json,development.json)
  7. koa-router

技术堆栈

  1. Node js
  2. koa2
  3. Sequelize
  4. Mysql/SQlite

安装并运行

1. git clone [email protected]:chungchi300/safe-start-koa2.git
//更改 database
2. src/config/default.js  (default sqlite but suggest mysql in production)
3. npm i && npm run reset && npm start

访问

  • http://localhost:3000
  • http://localhost:3000/feedback

测试服务器

  • http://45.76.76.16:3000/
  • http://45.76.76.16:3000/feedback

开发模式

文件修改后自动重启 Node.js 自动热重启服务

npm run start

在优酷上观看

测试驱动开发模式

Jest

npm run test

在优酷上观看

线上模式

pm2

npm run production

在优酷上观看

配置&&部署线上

默认配置文件位于 src/config/default.js.

.env 配置会覆盖(override) 默认配置.

e.g

.env/production.json 覆盖 src/config/default.js 配置

谢谢

使用部分代碼和概念於

17koa2

koa2-server