Giter Club home page Giter Club logo

egg-starter's Introduction

Egg-Starter

这是一个可以让您在短时间内构建Api的框架,它是基于EggJs官方的simple模板进行二次封装开发

功能模块

  • 🛠️ 统一错误处理机制
  • 🔒 JWT验证模块
  • 🧰 集成常用工具函数
  • 🔄 更好的路由管理
  • 🚀 基于EggJs快速构建Restful Api
  • 🌐 纯Javascript
  • 🐳 Sequelize Mysql
  • 🍭 支持 DB Migration / Model Sync
  • 📂 基于文件系统缓存服务
  • 📚 集成Swaggar文档
  • 🦄 集成Vscode代码片段
  • 🔧 ESlint
  • 💪 这些还不够? 欢迎您来提Issues / PR

如何食用

📥拉取代码

克隆最新的代码仓库到您的电脑上

git clone https://github.com/QC2168/egg-starter

📦安装依赖

进入项目目录,执行npm i进行安装依赖

npm i

推荐使用pnpm包管理器进行安装依赖

⚙️更新配置文件

编辑项目中的.env.development文件,修改数据库配置信息

DB_DIALECT=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_NAME=egg_starter
DB_USER=root
DB_PASSWORD=123456

如果您的设备未安装配置数据库,推荐使用Docker镜像安装数据库,具体查阅docker文档

🚀启动服务

npm run dev

默认服务地址为http://127.0.0.1:7001

如果您想要修改其他端口地址,请编辑.env.development文件,修改PORT配置项

🛠️部署

🚀 EggJs-应用部署 - 确保您的应用可以稳定运行

数据库迁移

🗄️ 您可以选用migrations来管理数据库迁移

🔄 也可以直接使用模型同步的方式来生成数据库表(更快更便捷)

💡 👇 开启模型同步的方式,请在.env.development文件中配置DB_MODE=syncDB即可

# .env.development
# 是否使用模型同步更新数据库
DB_MODE=syncDB

⚠️ 推荐使用数据库迁移的方式,因为模型同步的方式可能会导致数据丢失,且不支持回滚操作!!

最后

🎉 感谢您的使用,希望Egg-Starter能帮助您快速开发!

最最最后,球球一个Star 🌹🌹

egg-starter's People

Contributors

qc2168 avatar

Stargazers

kunkka avatar  avatar Zihao avatar tingke avatar 陈随易 avatar

Watchers

 avatar

Forkers

tianjianjun0727

egg-starter's Issues

求个eggjs学习资源

已star大佬
另外想问下有没有什么好的eggjs学习资源,最近在用这个框架

最好是文字文档教学型的,当然视频也可以接受

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.