-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.py
More file actions
21 lines (17 loc) · 738 Bytes
/
main.py
File metadata and controls
21 lines (17 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import requests
from flask import Flask
app = Flask(__name__)
app.config['DEBUG'] = True
@app.route('/daily')
def daily():
return requests.get('http://yourcompany.com/cron/?password=longstringshouldprobablyberandom&period=daily', verify=True).content
@app.route('/bimonthly')
def bimonthly():
return requests.get('http://yourcompany.com/cron/?password=longstringshouldprobablyberandom&period=bimonthly', verify=True).content
@app.route('/monthly')
def monthly():
return requests.get('http://yourcompany.com/cron/?password=longstringshouldprobablyberandom&period=monthly', verify=True).content
@app.errorhandler(404)
def page_not_found(e):
"""Return a custom 404 error."""
return 'Sorry, nothing at this URL.', 404