blob: 4b544c6d9e38b9a7091a6f41e51c42561e60d670 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
import os
import random
import string
from bottle import post, route, run, static_file
@route('/')
def index(name='home'):
return static_file('index.html', root=os.path.dirname(__file__), mimetype='text/html')
@route('/s/:id')
def sig(id='home'):
return '<p><b>Signature</b></p><p>%s</p>' % id
@post('/s')
def sig(id='home'):
id = ''.join(random.choice(string.ascii_lowercase + string.digits) for x in range(6))
return id
run(host='localhost', port=8000)
|