Giter Club home page Giter Club logo

server's Introduction

Server

CircleCI codecov

安装环境

本项目基于NodeJS,因此服务器上必须配备NodeJS才能正常运行本服务器。
同时本项目使用npm进行包管理,由于安装NodeJS环境的时候会自动安装npm因此无需另外安装。

建议的Node版本: v10.19.0

需要依赖:

  • Redis
  • MySQL

配置代码依赖

# 安装所有环境
$ npm install && npm run packages:install

配置数据库

本项目基于config作为配置管理方案

创建config/local.js文件, 参考config/default.js的内容进行配置的覆写

你可以以以下的配置例子作为起步配置

module.exports = {
  db: {
    database: 'trpg',
    username: 'root',
    password: 'root',
    options: {
      host: 'localhost',
      dialect: 'mysql',
    },
  },
  jwt: {
    secret: 'any string',
  },
  redisUrl: 'redis://127.0.0.1:6379/8',
};

写入数据库结构

$ npm run db:migrate:run

写入默认数据

$ npm run db:seeder:run

运行服务器

$ npm run dev
# or 
$ npm run pro

数据库编码

因为用户的输入奇奇怪怪。所以请确保数据库字符集为utf8mb4, 至少要确保chat_log.message的编码方式为utf8mb4

server's People

Contributors

dependabot[bot] avatar moonrailgun 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.