Skip to content

Instantly share code, notes, and snippets.

@skytreader
Created April 25, 2020 21:40
Show Gist options
  • Save skytreader/7c4eee263724b904a92514a9f0d4c7a7 to your computer and use it in GitHub Desktop.
Save skytreader/7c4eee263724b904a92514a9f0d4c7a7 to your computer and use it in GitHub Desktop.
iden.py
from flask import Flask
app = Flask(__name__)
"""
Usage: Install Flask, export this file as the `FLASK_APP` then `flask run`.
The resulting server will return the status code you as it for. Exemple gratis:
curl 127.0.0.1/404 - will return a 404
curl 127.0.0.1/500 - will return a 500
"""
@app.route("/<status>")
def index(status):
return "As you like it", int(status)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment