first commit
This commit is contained in:
7
app/main/__init__.py
Normal file
7
app/main/__init__.py
Normal file
@@ -0,0 +1,7 @@
|
||||
# coding=utf-8
|
||||
|
||||
from flask import Blueprint
|
||||
|
||||
main = Blueprint('main', __name__)
|
||||
|
||||
from . import views
|
||||
19
app/main/views.py
Normal file
19
app/main/views.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from flask import jsonify, Response
|
||||
from app import app
|
||||
|
||||
|
||||
@app.route('/robots.txt')
|
||||
@app.route('/sitemap.xml')
|
||||
def static_from_root():
|
||||
def disallow(string): return 'Disallow: {0}'.format(string)
|
||||
return Response("User-agent: *\n{0}\n".format("\n".join([
|
||||
disallow('/bin/*'),
|
||||
disallow('/admin'),
|
||||
])))
|
||||
|
||||
|
||||
@app.route('/index', methods=['GET'])
|
||||
@app.route('/', methods=['GET'])
|
||||
def index():
|
||||
return jsonify({"success": "Api is online"}), 200
|
||||
|
||||
Reference in New Issue
Block a user