Giter Site home page Giter Site logo

express-template's Introduction

express-template

基于 Express 的后端模版。预置 Mysql 作为数据存储。

CLI 工具

主要依赖

项目信息修改

  • 修改 package.json
  • 向 .gitignore 文件中添加 .env 与 compose.yaml

开发场景

基本环境

  • 安装依赖 npm install

数据库

  • Mysql

    • 修改 prisma/schema.prisma 中库表定义
    • 修改 .env 中数据库连接相关定义
    • 执行make mysql DB_PASSWORD=? DB_NAME=?,启动 mysql 容器
    • 执行npm run migrate-dev-init数据库表创建
    • 执行npm run prisma-gen更新 prismaClient 定义

编译运行

  • 执行npm run start-dev,启动服务(热更新)

部署场景

  • 修改根目录下 compose.yaml 与 makefile 相关信息
  • 应用容器化
    • 方法一:在服务器端拉取代码,执行make build_images,打包镜像
    • 方法二:本地执行make build_push_multi,打包多平台镜像并推至 hub

Compose 方式部署

参考 docker compose

  • docker compose up -d 后台运行
  • docker compose logs 查看日志
  • docker compose down 结束运行并删除容器

express-template's People

Contributors

banana-boat 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.