diff --git a/README.md b/README.md index 767f437..743422f 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ You can run the node server by moving to the server directory and running `npm s The Angular Development Server can be started by running `ng serve` -Endpoints are configured to proxy to the node server. +Endpoints are configured to proxy to the node server, which is running on http://localhost:3000. The Angular App will be running on http://localhost:4200 The proxy is setup to send `/api/[endpoint]` to the server. Keep this in mind while in development. # Building diff --git a/angular.json b/angular.json index 7eca070..cd84da3 100644 --- a/angular.json +++ b/angular.json @@ -55,12 +55,12 @@ "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { - "browserTarget": "rock-paper-scissors:build" + "browserTarget": "rock-paper-scissors:build", + "proxyConfig": "src/proxy.conf.json" }, "configurations": { "production": { - "browserTarget": "rock-paper-scissors:build:production", - "proxyConfig": "src/proxy.conf.json" + "browserTarget": "rock-paper-scissors:build:production" } } }, diff --git a/server/app.js b/server/app.js index 833a4a4..d790a14 100644 --- a/server/app.js +++ b/server/app.js @@ -21,7 +21,7 @@ app.use(bodyParser.urlencoded({ extended: false })); app.use(cookieParser()); app.use(express.static(path.join(__dirname, '../dist'))); -app.use('/', routes); +app.use('/api', routes); // catch 404 and forward to error handler app.use(function(req, res, next) {