File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33module . exports = {
44 db : {
5- database : 'lin-cms5 ' ,
5+ database : 'lin-cms ' ,
66 host : 'localhost' ,
77 dialect : 'mysql' ,
88 port : 3306 ,
99 username : 'root' ,
10- password : '123456 ' ,
10+ password : 'root ' ,
1111 logging : false ,
1212 timezone : '+08:00'
1313 } ,
Original file line number Diff line number Diff line change 11'use strict' ;
22
3+ let siteDomain
4+ switch ( process . env . NODE_ENV ) {
5+ case 'development' :
6+ siteDomain = 'http://localhost:5000' ;
7+ break ;
8+ case 'production' :
9+ siteDomain = '' ;
10+ break ;
11+ }
312module . exports = {
413 port : 5000 ,
5- siteDomain : 'http://localhost:5000' ,
14+ siteDomain,
615 countDefault : 10 ,
716 pageDefault : 0 ,
817 apiDir : 'app/api' ,
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ class LocalUploader extends Uploader {
4949 arr . push ( {
5050 key : file . fieldname ,
5151 id : saved . id ,
52+ path : `${ saved . path } ` ,
5253 url : `${ siteDomain } /assets/${ saved . path } `
5354 } ) ;
5455 }
Original file line number Diff line number Diff line change 44 "description" : " simple and practical CMS implememted by koa" ,
55 "main" : " app/starter.js" ,
66 "scripts" : {
7- "start:dev" : " nodemon" ,
8- "start:prod" : " node app/starter.js" ,
7+ "start:dev" : " cross-env NODE_ENV=development nodemon" ,
8+ "start:prod" : " cross-env NODE_ENV=production node app/starter.js" ,
99 "prettier" : " prettier --write app/**/*.js app/*.js app/**/**/*.js app/**/**/**/*.js tests/**/*.js && eslint app tests --fix"
1010 },
1111 "keywords" : [
2323 "@types/koa__cors" : " ^2.2.3" ,
2424 "@types/prettier" : " 1.16.1" ,
2525 "@types/supertest" : " ^2.0.7" ,
26+ "cross-env" : " ^5.2.0" ,
2627 "eslint" : " ^5.15.1" ,
2728 "eslint-config-standard" : " ^12.0.0" ,
2829 "eslint-plugin-import" : " ^2.16.0" ,
You can’t perform that action at this time.
0 commit comments