Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error messaging when requiring routes, add CLI tests #828

Merged
merged 11 commits into from
Jan 28, 2017
5 changes: 2 additions & 3 deletions packages/react-server-cli/src/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ export default function run(options = {}) {
options.routesPath = path.resolve(process.cwd(), routesFile);
options.routesDir = path.dirname(options.routesPath);

try {
// No routes file available when performing init command
if (options.command !== 'init') {
options.routes = require(options.routesPath);
} catch (e) {
// Pass. Commands need to check for routes themselves.
}

options.outputUrl = jsUrl || `${httpsOptions ? "https" : "http"}://${host}:${jsPort}/`;
Expand Down