Introduction
Based on the WSGI idea, Bottle is a microframework. It is a very portable and tiny framework, making it ideal for use with IoT and other modest compute platforms. With support for URL parameters, templates, an integrated web server, and adapters for numerous third-party WSGI/HTTP-serve, Bottle offers very good request dispatching (routes).

Now, let’s see how to print an introductory statement like ‘Hello World’ in the Bottle framework.
How to Print ‘Hello World’ in Bottle?
This article presumes that you have Bottle installed or copied into your project directory. Let's begin with an elementary example of "Hello World" in Bottle. Mostly every new programmer does this program as an introduction to Coding.
from bottle import route, run
@route('/hello')
def hello():
return "Hello World"
run(host='localhost', port=8080, debug=True)
That's it. When you run this script and go to http://localhost:8080/hello, your browser will display "Hello World" in Bottle.

👉The route() decorator links a piece of code to a URL path. In this instance, the hello() function is connected to the /hello directory. The most significant idea in this framework is what is known as a route (thus the decorator name). As many routes as you like can be defined. The associated function is called each time a browser requests a URL, and the result is returned to the browser. That is all there is to it.
👉The run() command in the final line starts a built-in development server. Until you press Control-c, it responds to requests on localhost port 8080. We only require a development server right now, but you can change the backend later. Having your application run for local tests is effortless and requires no setup.
The Debug Mode, which should be deactivated for programs used by the general public, is beneficial during the early phases of development. Keep it in mind.
This is an example of the fundamental idea behind how Bottle apps are created. You can find out what else is possible by reading on.
The Default Application

Most examples in the Bottle framework define routes using a module-level route() decorator for simplicity. The "default application" automatically built the first time you call route() is a global one that receives these routes as an addition. This default application is related to many other module-level decorators and functions. Still, you may construct a different application object and use that in place of the global one if you prefer a more object-oriented approach. Don't mind the extra typing:
from bottle import Bottle, run
app = Bottle()
@app.route('/hello')
def hello():
return "Hello World"
run(app, host='localhost', port=8080)
The Default Application section details the object-oriented methodology. Remember that you have an option.





