forked from charlesflynn/eve-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
30 lines (23 loc) · 893 Bytes
/
example.py
File metadata and controls
30 lines (23 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# -*- coding: utf-8 -*-
"""
Eve Demo
~~~~~~~~
A demostration of a simple API powered by Eve REST API.
The live demo is available at eve-demo.herokuapp.com. Please keep in mind
that the it is running on Heroku's free tier using a free MongoHQ
sandbox, which means that the first request to the service will probably
be slow. The database gets a reset every now and then.
:copyright: (c) 2012 by Nicola Iarocci.
:license: BSD, see LICENSE for more details.
"""
import os
from eve import Eve
from flask.ext.bootstrap import Bootstrap
from eve_docs import eve_docs
if __name__ == '__main__':
# Heroku support: bind to PORT if defined, otherwise default to 5000.
port = int(os.environ.get('PORT', 5000))
app = Eve()
Bootstrap(app)
app.register_blueprint(eve_docs, url_prefix='/docs')
app.run(host='0.0.0.0', port=port, debug=True)