Skip to content

Commit

Permalink
feat: 初始化仓库
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuSongJiang committed Apr 8, 2019
0 parents commit 59d4ba8
Show file tree
Hide file tree
Showing 31 changed files with 7,894 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = native
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules/
build/
.vscode/
npm-debug.log
*.DS_Store
.idea
debug.log
yarn-error.log
13 changes: 13 additions & 0 deletions .sequelizerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

const path = require('path')

module.exports = {

'config': path.resolve('src/db','config.json'),


'models-path': path.resolve('src/db','models'),

'seeders-path': path.resolve('src/db','seeders'),

}
14 changes: 14 additions & 0 deletions bin/creat_db.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const process = require("process");

const { exec } = require('child_process');
// 输出当前目录(不一定是代码所在的目录)下的文件和文件夹
exec('node_modules/.bin/sequelize db:create', (err, stdout, stderr) => {
if(err) {
console.log(err);
return;
}
console.log(`stdout: ${stdout}`);
console.log(`stderr: ${stderr}`);
})

console.log(process.argv);
10 changes: 10 additions & 0 deletions bin/init_db.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const { exec } = require('child_process');
// 初始化数据库配置
exec('node_modules/.bin/sequelize init', (err, stdout, stderr) => {
if(err) {
console.log(err);
return;
}
console.log(`stdout: ${stdout}`);
console.log(`stderr: ${stderr}`);
})
17 changes: 17 additions & 0 deletions config.dev.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"database": {
"url": "mysql://root:831015@127.0.0.1:3306/RUNOOB"
},
"weChat": {
"wxAppid": "wx6646cee3ccecceaa",
"wxSecret": "a413d6545e63a35fc2a0336d66534b89"
},
"server": {
"port": 5000,
"host": "localhost",
"jwtSecret": "random-secret-password",
"jwtExpiration": "1h",
"routePrefix": "",
"plugins": ["hapi-auth-jwt2", "hapi-pagination", "hapi-swagger"]
}
}
23 changes: 23 additions & 0 deletions config.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"database": {
"host": "localhost",
"port": 3306,
"database": "RUNOOB",
"username": "root",
"password": 831015,
"dialect": "mysql",
"operatorsAliases": false
},
"weChat": {
"wxAppid": "wx6646cee3ccecceaa",
"wxSecret": "a413d6545e63a35fc2a0336d66534b89"
},
"server": {
"port": 5000,
"host": "localhost",
"jwtSecret": "random-secret-password",
"jwtExpiration": "1h",
"routePrefix": "",
"plugins": ["hapi-auth-jwt2", "hapi-pagination", "hapi-swagger"]
}
}
Empty file added jsconfig.json
Empty file.
Loading

0 comments on commit 59d4ba8

Please sign in to comment.