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 0000000..b8a15ba Binary files /dev/null and b/src/assets/Paper-50.png differ diff --git a/src/assets/Play-50.png b/src/assets/Play-50.png new file mode 100755 index 0000000..c031b56 Binary files /dev/null and b/src/assets/Play-50.png differ diff --git a/src/assets/Rock-50.png b/src/assets/Rock-50.png new file mode 100755 index 0000000..e43c892 Binary files /dev/null and b/src/assets/Rock-50.png differ diff --git a/src/assets/Scissors-50.png b/src/assets/Scissors-50.png new file mode 100755 index 0000000..380814c Binary files /dev/null and b/src/assets/Scissors-50.png differ diff --git a/src/proxy.conf.json b/src/proxy.conf.json deleted file mode 100644 index a01ed10..0000000 --- a/src/proxy.conf.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "/api": { - "target": "http://localhost:3000/", - "secure": false - } -}