Skip to content

Commit fb9fe59

Browse files
author
pedro
authored
Merge pull request #31 from TaleLin/dev
publish new version
2 parents 8a41345 + 5609921 commit fb9fe59

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

app/config/secure.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module.exports = {
44
db: {
5-
database: 'lin-cms5',
5+
database: 'lin-cms',
66
host: 'localhost',
77
dialect: 'mysql',
88
port: 3306,

app/config/setting.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
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+
}
312
module.exports = {
413
port: 5000,
5-
siteDomain: 'http://localhost:5000',
14+
siteDomain,
615
countDefault: 10,
716
pageDefault: 0,
817
apiDir: 'app/api',

app/extensions/file/local-uploader.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
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": [
@@ -23,6 +23,7 @@
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",
@@ -42,6 +43,6 @@
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
}

0 commit comments

Comments
 (0)