File tree Expand file tree Collapse file tree 6 files changed +35
-10
lines changed
containers/home/article_item Expand file tree Collapse file tree 6 files changed +35
-10
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ services:
11
11
ports :
12
12
- 8001:80
13
13
volumes :
14
- - webDist:/webDist
14
+ - webDir:/webDir
15
15
16
16
17
17
web :
@@ -20,7 +20,7 @@ services:
20
20
dockerfile : Dockerfile
21
21
container_name : blog_web
22
22
volumes :
23
- - webDist :/www/web/build
23
+ - webDir :/www/web/build
24
24
25
25
volumes :
26
- webDist :
26
+ webDir :
Original file line number Diff line number Diff line change 1
1
# hzjio.com web side
2
2
server {
3
3
listen 80 ;
4
- root /webDist ;
4
+ root /webDir ;
5
5
6
6
location / {
7
7
index index.html;
Original file line number Diff line number Diff line change 3
3
// Do this as the first thing so that any code reading it knows the right env.
4
4
process . env . BABEL_ENV = 'development' ;
5
5
process . env . NODE_ENV = 'development' ;
6
+ process . env . PORT = '3001' ;
6
7
7
8
// Makes the script crash on unhandled rejections instead of silently
8
9
// ignoring them. In the future, promise rejections that are not handled will
Original file line number Diff line number Diff line change 1
- export const Config = {
1
+ let config : AppConfig ;
2
2
3
+
4
+ const mockConfig = {
3
5
/** api域名 */
4
6
// ApiDomain : 'https://www.hzjio.com'
5
7
6
8
/** mock api domain */
7
- ApiDomain : 'http://mock.eolinker.com/betP9Ab5500fe5e2f88721c31b19e9898cac277e32e6866?uri='
8
- } ;
9
+ ApiDomain : 'http://mock.eolinker.com/betP9Ab5500fe5e2f88721c31b19e9898cac277e32e6866?uri='
10
+ } ;
11
+
12
+ const devConfig = {
13
+ ApiDomain : 'http://localhost:3000'
14
+ } ;
15
+
16
+ const prodConfig = {
17
+ ApiDomain : 'http://api.hzjio.com'
18
+ } ;
19
+
20
+ if ( process . env . NODE_ENV === 'development' ) {
21
+ config = devConfig ;
22
+ } else if ( process . env . NODE_ENV === 'mock' ) {
23
+ config = mockConfig ;
24
+ } else {
25
+ config = prodConfig ;
26
+ }
27
+
28
+ export default config ;
29
+
30
+ interface AppConfig {
31
+ ApiDomain : string ;
32
+ }
Original file line number Diff line number Diff line change 1
- import { Config } from "../app_config" ;
1
+ import Config from "../app_config" ;
2
2
3
3
/** api 域名 */
4
4
export const ApiDomain = Config . ApiDomain ;
Original file line number Diff line number Diff line change 1
1
import * as React from "react" ;
2
- import './article_item.scss' ;
3
2
import { Link } from "react-router-dom" ;
3
+ import './article_item.scss' ;
4
4
5
5
export class HomeArticleItem extends React . Component < HomeArticleItemProps > {
6
6
@@ -10,7 +10,7 @@ export class HomeArticleItem extends React.Component<HomeArticleItemProps> {
10
10
11
11
public render ( ) {
12
12
return (
13
- < Link to = { `articles /${ this . props . id } ` } href = "javascript:;" className = "homeArticle" >
13
+ < Link to = { `article /${ this . props . id } ` } href = "javascript:;" className = "homeArticle" >
14
14
< div className = "homeArticle-title" > { this . props . title } </ div >
15
15
< div className = "homeArticle-summary" > { this . props . summary } </ div >
16
16
</ Link >
You can’t perform that action at this time.
0 commit comments