mirror of https://github.com/01-edu/public.git
fix: issue #679
This commit is contained in:
parent
30328fd301
commit
bde53b0b8e
|
@ -7,11 +7,13 @@ Ascii-art-web consists in creating and running a server, in which it will be pos
|
|||
Your web-page should provide usage of different [banners](https://github.com/01-edu/public/tree/master/subjects/ascii-art).
|
||||
|
||||
Implement following HTTP endpoints:
|
||||
|
||||
1. GET `/`: Sends HTML response - the main page.
|
||||
2. POST `/ascii-art`: Receives _JSON_ body with the following data and returns _JSON_ response with the result of _ascii-art_:
|
||||
|
||||
Request body:
|
||||
```js
|
||||
|
||||
```json
|
||||
{
|
||||
"banner": "shadow",
|
||||
"text": "Your text here"
|
||||
|
@ -19,7 +21,8 @@ Request body:
|
|||
```
|
||||
|
||||
Response body:
|
||||
```js
|
||||
|
||||
```json
|
||||
{
|
||||
"result": "..."
|
||||
}
|
||||
|
@ -33,6 +36,7 @@ Main page must have:
|
|||
### HTTP status code
|
||||
|
||||
Your endpoints must return appropriate HTTP status codes.
|
||||
|
||||
- OK (200), if everything went without errors
|
||||
- Not Found, if anything is not found, e.g: template, banner etc.
|
||||
- Bad Request, for incorrect requests
|
||||
|
|
|
@ -25,7 +25,6 @@ const update = state => {
|
|||
// Each AIs contains:
|
||||
// color: A number that represent the color of a AI
|
||||
// name: A string of the AI name
|
||||
// score: A number of the total block collected by this AI
|
||||
// coords: An array of 4 coordinates of the nearest blocks
|
||||
|
||||
// Each coordinate (and AI) contains:
|
||||
|
@ -46,6 +45,7 @@ const update = state => {
|
|||
|
||||
// Saving state between each updates:
|
||||
// I update the MAP with the new position of each AIs
|
||||
console.log(state)
|
||||
state.ais.forEach(addToMap)
|
||||
|
||||
// Actual AI logic:
|
||||
|
|
Loading…
Reference in New Issue