Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
config: {
apiUrl: API_ROUTE_PATH,
baseUrl: host,
enableServiceWorker,
requestLanguage,
supportedLangs,
initialNow: new Date().getTime(),
variants: getVariants(state),
entryPath: url.pathname, // the path that the user entered the app on
media: getMedia(userAgent, userAgentDevice),
},
flags,
};
const createStore = getServerCreateStore(
getRouteResolver(routes, basename),
middleware,
request
);
return Promise.resolve(createStore(reducer, initialState));
});
export function resolveAppProps(
routes: Array,
reducer: Reducer,
middleware: Array = []
): Promise {
const basename = window.APP_RUNTIME.basename || '';
const resolveRoutes = getRouteResolver(routes, basename);
const createStore = getBrowserCreateStore(resolveRoutes, middleware);
const store = createStore(reducer, getInitialState(window.APP_RUNTIME));
return resolveRoutes(window.location).then(() => ({
routes,
store,
basename,
}));
}