File tree Expand file tree Collapse file tree 4 files changed +18
-6
lines changed
Expand file tree Collapse file tree 4 files changed +18
-6
lines changed 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 ,
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 @@ -26,6 +26,7 @@ class LocalUploader extends Uploader {
2626 arr . push ( {
2727 key : file . fieldname ,
2828 id : exist . id ,
29+ path : `${ exist . path } ` ,
2930 url : `${ siteDomain } /assets/${ exist . path } `
3031 } ) ;
3132 } else {
@@ -49,6 +50,7 @@ class LocalUploader extends Uploader {
4950 arr . push ( {
5051 key : file . fieldname ,
5152 id : saved . id ,
53+ path : `${ saved . path } ` ,
5254 url : `${ siteDomain } /assets/${ saved . path } `
5355 } ) ;
5456 }
Original file line number Diff line number Diff line change 11{
22 "name" : " lin-cms-koa" ,
3- "version" : " 0.1 .0-beta.3 " ,
3+ "version" : " 0.2 .0-beta.1 " ,
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" ,
4243 "koa-bodyparser" : " ^4.2.1" ,
4344 "koa-mount" : " ^4.0.0" ,
4445 "koa-static" : " ^5.0.0" ,
45- "lin-mizar" : " ^0.1 .0-beta.5 "
46+ "lin-mizar" : " ^0.2 .0-beta.1 "
4647 }
4748}
You can’t perform that action at this time.
0 commit comments