From e682bfe94be16925e1fdcd881bf71cc1edec83fc Mon Sep 17 00:00:00 2001 From: Anthony Sgueglia Date: Wed, 25 Mar 2020 19:16:48 -0400 Subject: [PATCH] added images removed proxying. --- README.md | 14 ++++++-------- angular.json | 3 +-- src/app/app.component.html | 2 +- src/assets/Paper-50.png | Bin 0 -> 792 bytes src/assets/Play-50.png | Bin 0 -> 586 bytes src/assets/Rock-50.png | Bin 0 -> 1650 bytes src/assets/Scissors-50.png | Bin 0 -> 1248 bytes src/proxy.conf.json | 6 ------ 8 files changed, 8 insertions(+), 17 deletions(-) create mode 100755 src/assets/Paper-50.png create mode 100755 src/assets/Play-50.png create mode 100755 src/assets/Rock-50.png create mode 100755 src/assets/Scissors-50.png delete mode 100644 src/proxy.conf.json diff --git a/README.md b/README.md index 743422f..8080c69 100644 --- a/README.md +++ b/README.md @@ -16,21 +16,19 @@ From server, run `npm install` to install dependencies for the server. Write your Angular source code in the /src folder. -You can run the node server by moving to the server directory and running `npm start` +You can run the node server by moving to the `server` directory and running `npm start` which will run the node server at http://localhost:3000 (this houses our API.) -The Angular Development Server can be started by running `ng serve` - -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. +The Angular Development Server can be started by running `ng serve` which will serve the Angular application on http://localhost:4200 # Building Build your project using `ng build` from the root -To start the server, run `npm start` in the server folder. You can access the game's GUI at `http://localhost:3000` +To start the server, run `npm start` in the server folder. You can access the game's GUI at `http://localhost:3000` and the node server will serve a static Angular app. ## The API -To play the game, make a POST request to `http://localhost:3000/match` with a single body parameter, `choice`, the value of which should be either "rock", "paper", or "scissors". The server will randomly choose one of those three options to play against your choice and return the results of the game as a JSON object with the following properties: +To play the game, make a POST request to `http://localhost:3000/api/match` with a single body parameter, `choice`, the value of which should be either "rock", "paper", or "scissors". The server will randomly choose one of those three options to play against your choice and return the results of the game as a JSON object with the following properties: playerChoice : [your choice] computerChoice : [rock|paper|scissors] @@ -40,11 +38,11 @@ The server will return a status of 400 if the `choice` parameter is omitted or d You can test the API using cURL thusly: - $ curl -X POST -d choice=[rock|paper|scissors] http://localhost:3000/match + $ curl -X POST -d choice=[rock|paper|scissors] http://localhost:3000/api/match ## The GUI -All front end assets can be found in the `public` directory. Please use a AngularJS to build a single page application for playing the game. You may structure your Angular app as you like and you may add to or modify any of the code in here. Visually, the design does not have to be perfect, but the game should look presentable. +All front end assets can be found in the `src/assets` directory. Please use a Angular to build a single page application for playing the game. You may structure your Angular app as you like and you may add to or modify any of the code in here. Visually, the design does not have to be perfect, but the game should look presentable. #### Requirements diff --git a/angular.json b/angular.json index cd84da3..fa8447c 100644 --- a/angular.json +++ b/angular.json @@ -55,8 +55,7 @@ "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { - "browserTarget": "rock-paper-scissors:build", - "proxyConfig": "src/proxy.conf.json" + "browserTarget": "rock-paper-scissors:build" }, "configurations": { "production": { diff --git a/src/app/app.component.html b/src/app/app.component.html index f48352c..777a057 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -4,4 +4,4 @@ Welcome to {{title}}! - + diff --git a/src/assets/Paper-50.png b/src/assets/Paper-50.png new file mode 100755 index 0000000000000000000000000000000000000000..b8a15ba89ef4465688fc5a418d9f6baf19643d83 GIT binary patch literal 792 zcmV+z1LypSP)~gc9894ID~v>v#h31fyFM3p~NFHnEsF0eS+*O`yt! z%mx=u@~vh_s?%wxkc7DD?4UaT_xta?pH8|FQeLKO4*}pLG57_K5a~_K5b#ssh;}^9SGV8n>e+gymX?;5mR1Q*_S)A^ zCm00L-Uu1SX#V8oXivpghAqVGWlnfguG~N#e)-s7hH+#d9+Uwn;M*09UCvwG*tSJx zARIu&FwPO66aZ3@76D_&BA84-IEXujF#&*T87!!B1c+VHhdTqQPKMRHzCZm>OhlLh z#tw5aQg^IVL_CWk5?up8YzMV4mTrCbLe3RbDx=&UNl++JTo?$xf#lk}g-1Z-eZgE` z8co+Gu|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@@ -1,6 +0,0 @@ -{ - "/api": { - "target": "http://localhost:3000/", - "secure": false - } -}