Created
June 28, 2015 13:59
-
-
Save joffilyfe/bfdceef6057dbfc7f84d to your computer and use it in GitHub Desktop.
Exemplo com Flask
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from flask import Flask | |
app = Flask(__name__) | |
# Index | |
@app.route("/") | |
def index(): | |
return "Estamos na página principal" | |
# Página de saudação | |
@app.route("/hello/", defaults={"nome": "Visitante"}) | |
@app.route("/hello/<string:nome>") | |
def say_hello(nome): | |
return "Olá {}".format(nome) | |
# Rodando a aplicação | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment