File tree Expand file tree Collapse file tree 6 files changed +15
-4
lines changed Expand file tree Collapse file tree 6 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 5
5
6
6
export default function ( baseApi ) {
7
7
return {
8
+ route : {
9
+ baseRoute : '' ,
10
+ } ,
8
11
api : {
9
12
shows : `${ baseApi } /shows/:showId` ,
10
13
episodes : `${ baseApi } /shows/:showId/episodes` ,
Original file line number Diff line number Diff line change 1
1
import environment from './base' ;
2
2
3
- const baseApi = 'http ://api.tvmaze.com' ;
3
+ const baseApi = 'https ://api.tvmaze.com' ;
4
4
const env = environment ( baseApi ) ;
5
5
6
6
export default {
Original file line number Diff line number Diff line change @@ -5,9 +5,13 @@ import environment from './base';
5
5
* You shouldn't have override anything.
6
6
*/
7
7
8
- const baseApi = 'http ://api.tvmaze.com' ;
8
+ const baseApi = 'https ://api.tvmaze.com' ;
9
9
const env = environment ( baseApi ) ;
10
10
11
11
export default {
12
12
...env ,
13
+ route : {
14
+ ...env . route ,
15
+ baseRoute : '/react-redux-architecture' , // Fixes issue with Github Pages
16
+ } ,
13
17
} ;
Original file line number Diff line number Diff line change 1
1
import environment from './base' ;
2
2
3
- const baseApi = 'http ://api.tvmaze.com' ;
3
+ const baseApi = 'https ://api.tvmaze.com' ;
4
4
const env = environment ( baseApi ) ;
5
5
6
6
export default {
Original file line number Diff line number Diff line change @@ -6,10 +6,11 @@ import { Provider } from 'react-redux';
6
6
import { createBrowserHistory } from 'history' ;
7
7
import rootStore from './stores/rootStore' ;
8
8
import App from './views/App' ;
9
+ import environment from 'environment' ;
9
10
10
11
( async ( window ) => {
11
12
const initialState = { } ;
12
- const history = createBrowserHistory ( ) ;
13
+ const history = createBrowserHistory ( { basename : environment . route . baseRoute } ) ;
13
14
const store = rootStore ( initialState , history ) ;
14
15
15
16
const rootEl = document . getElementById ( 'root' ) ;
Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ declare module 'lodash.groupby';
3
3
4
4
declare module 'environment' {
5
5
const value : {
6
+ route : {
7
+ baseRoute : string ;
8
+ } ;
6
9
api : {
7
10
shows : string ;
8
11
episodes : string ;
You can’t perform that action at this time.
0 commit comments