20 lines
566 B
Python
20 lines
566 B
Python
|
from bottle import route, run,template
|
||
|
|
||
|
@route('/')
|
||
|
@route('/myapp')
|
||
|
@route('/myapp/')
|
||
|
def myApp():
|
||
|
return '<b style="color:green">Hello Sandeep .Bottle Framework demonstration route.</b>'
|
||
|
|
||
|
|
||
|
@route('/myapp/<name>')
|
||
|
def myName(name):
|
||
|
return template('<b style="color:green">Hello <b style="color:red"> {{name}}</b>. Bottle Framework demonstration route with template string.', name=name)
|
||
|
|
||
|
|
||
|
@route('/myapp/favourite/')
|
||
|
@route('/myapp/favourite/<item>')
|
||
|
def favourite(item):
|
||
|
return template('favourite_template', item=item)
|
||
|
|
||
|
run(host='localhost', port=9093)
|