http-server mac install 1

http-server mac install

brew install http-server

Here is what the above code is Doing:
1. We’re importing the Flask class from the flask module.
2. We’re creating an instance of the Flask class. The first argument is the name of the application’s module or package. If you are using a single module (as in this example), you should use __name__ because depending on if it’s started as application or imported as module the name will be different (‘__main__’ versus the actual import name). This is needed so that Flask knows where to look for templates, static files, and so on. For more information have a look at the Flask documentation.
3. We’re creating a Flask route. This is basically a URL that the application implements. In this example the URL is http://localhost:5000/ and the associated implementation is the hello_world() function.
4. The hello_world() function is the function that is associated with the URL /. When a web browser requests the URL http://localhost:5000/, the hello_world() function is called.
5. The hello_world() function returns the message ‘Hello, World!’.
6. The run() function runs the application on a local development server.

Similar Posts