From 848c7d9e222964b5e8c5bc226ee12eb58820d578 Mon Sep 17 00:00:00 2001 From: lee Date: Thu, 19 Nov 2020 11:30:26 +0000 Subject: [PATCH] ascii-art-web: correcting subject --- subjects/ascii-art-web/README.md | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/subjects/ascii-art-web/README.md b/subjects/ascii-art-web/README.md index 2a6582e2..40a166cb 100644 --- a/subjects/ascii-art-web/README.md +++ b/subjects/ascii-art-web/README.md @@ -2,36 +2,23 @@ ### Objectives -Ascii-art-web consists in creating and running a server, in which it will be possible to use a web **GUI** (graphical user interface) version of your last project, ascii-art. +Ascii-art-web consists in creating and running a server, in which it will be possible to use a web **GUI** (graphical user interface) version of your last project, [ascii-art](https://public.01-edu.org/subjects/ascii-art/). 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_: +1. GET `/`: Sends HTML response - the main page.\ + 1.1. GET Tip: [go templates](https://golang.org/pkg/html/template/) to receive and display data from the server -Request body: - -```json -{ - "banner": "shadow", - "text": "Your text here" -} -``` - -Response body: - -```json -{ - "result": "..." -} -``` +2. POST `/ascii-art`: that sends data to Go server (text and a banner)\ + 2.1. POST Tip: use form and other types of [tags](https://developer.mozilla.org/en-US/docs/Web/HTML/Element) to make the post request.\ Main page must have: + - text input - radio buttons, select object or anything else to choose between banners -- button, which sends _AJAX_ request to '/ascii-art' and outputs the result on page. +- button, which sends a POST request to '/ascii-art' and outputs the result on page. ### HTTP status code @@ -45,6 +32,7 @@ Your endpoints must return appropriate HTTP status codes. ## Markdown In root project directory create `README.MD` file with the following sections and contents: + - Description - Authors - Usage: how to run @@ -55,6 +43,7 @@ In root project directory create `README.MD` file with the following sections an - Only the [standard go](https://golang.org/pkg/) packages are allowed ### Instructions + - HTTP server must be written in _Go_. - HTML templates must be in project root directory _templates_. - The code must respect the [good practices](https://public.01-edu.org/subjects/good-practices/).