mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Tlekbai Ali
8dd1a0b8d6
|
4 years ago | |
---|---|---|
.. | ||
audit | 4 years ago | |
dockerize | 4 years ago | |
export-file | 4 years ago | |
stylize | 4 years ago | |
README.md | 4 years ago |
README.md
ascii-art-web
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.
Your web-page should provide usage of different banners.
Implement following HTTP endpoints:
- GET
/
: Sends HTML response - the main page. - POST
/ascii-art
: Receives JSON body with the following data and returns JSON response with the result of ascii-art:
Request body:
{
"banner": "shadow",
"text": "Your text here"
}
Response body:
{
"result": "..."
}
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.
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
- Internal Server Error, for unhandled errors
Markdown
In root project directory create README.MD
file with the following sections and contents:
- Description
- Authors
- Usage: how to run
- Implementation details: algorithm
Allowed packages
- Only the standard go 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.