Skip to content

Instantly share code, notes, and snippets.

@andreburto
Created April 28, 2017 00:34
Show Gist options
  • Save andreburto/3930e0c10f9913e612329df4ef2e4824 to your computer and use it in GitHub Desktop.
Save andreburto/3930e0c10f9913e612329df4ef2e4824 to your computer and use it in GitHub Desktop.
import web
from exceptions import ValueError
urls = ('/', 'Index')
store_url = 'No_url'
class Index:
def GET(self):
return store_url
def POST(self, url=None):
if url:
store_url = url
return 'success'
else:
raise ValueError('No url provided')
app = web.application(urls, globals())
if __name__ == '__main__':
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment