Skip to content

Commit

Permalink
Modify CRA dev server to serve Cesium files from node_modules
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Mar 7, 2017
1 parent 73bdbe2 commit eabdcf5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/start.js
Expand Up @@ -18,6 +18,8 @@ var formatWebpackMessages = require('react-dev-utils/formatWebpackMessages');
var getProcessForPort = require('react-dev-utils/getProcessForPort');
var openBrowser = require('react-dev-utils/openBrowser');
var prompt = require('react-dev-utils/prompt');
var express = require("express");

var fs = require('fs');
var config = require('../config/webpack.config.dev');
var paths = require('../config/paths');
Expand Down Expand Up @@ -151,6 +153,11 @@ function onProxyError(proxy) {
}

function addMiddleware(devServer) {

// Handle requests for Cesium static assets that we want to
// serve up direct from /node_modules/cesium/.
devServer.use("/cesium", express.static(paths.cesiumDebugBuild));

// `proxy` lets you to specify a fallback server during development.
// Every unrecognized request will be forwarded to it.
var proxy = require(paths.appPackageJson).proxy;
Expand Down

0 comments on commit eabdcf5

Please sign in to comment.