mariusavram91/trees
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
master
Could not load branches
Nothing to show
Could not load tags
Nothing to show
{{ refName }}
default
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
-
Clone
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more about the CLI.
- Open with GitHub Desktop
- Download ZIP
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
# Simple Web Server for happy trees ******************************* Create a simple web server, using only the standard library packages of your choice of python, go or nodejs, that does the following: Only accepts POST requests. For any request, checks the body for a json encoded object and returns a descriptive HTTP error code if the body does not contain a valid json object. We expect this object to look like this: {"favoriteTree": "baobab"} Only accepts requests on the index URL: "/", and returns the proper HTTP error code if a different URL is requested. Runs locally on port 8000. For a successful request, returns a properly encoded HTML document with the following content: If "favoriteTree" was specified: It's nice to know that your favorite tree is a <value of "favoriteTree" in the POST body>! If not specified: Please tell me your favorite tree. ******************************* ## Environment If you don't have Python you can follow the instructions from https://www.python.org/downloads/. Make sure to install Python 3.x First, create an environment. ``` $ virtualenv env ``` If you have both python 2.x and 3.x versions, use the below command. ``` $ virtualenv --python=/usr/bin/python3 env ``` You can activate it. ``` $ source ./env/bin/activate ``` Verify the version of python with the below command. ``` $ python Python 3.5.2 (default, Nov 23 2017, 16:37:01) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> ``` When not using you can deactivate it. ``` $ deactivate ``` ## Run the server Python 3 is a requirement, it should run out of the box on the create env with: ``` $ python trees.py ``` While running the server you can run the tests with the constraints using: ``` $ python test_trees.py ``` Check out the Bob Ross related Easter Eggs! :)
About
Post favourite tree. 🌴
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published