-
Notifications
You must be signed in to change notification settings - Fork 6
/
run.py
71 lines (61 loc) · 2.02 KB
/
run.py
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
"""App entry point."""
# from application import create_app
from application.core import core_routes
from application.user import user_routes, user_role_routes
from application.song import song_routes, song_artist_routes
from application.cart import cart_routes
from application.album import album_routes, album_artist_routes
from application.contributor import contributor_routes
from flask import Flask
from flask_cors import CORS
import pymongo
import ssl
import urllib.parse
from flask import request, jsonify
app = Flask(__name__)
CORS(app)
"""
Running locally you need this connection string
"""
# db_url = 'mongodb://user:password@127.0.0.1:27018/raidar'
# app.aws_client = ''
# app.aws_secret = ''
# app.aws_region_name = 'us-east-1'
# app.aws_s3_song_wav = ''
# app.aws_s3_song_preview = ''
# app.aws_es_url = ''
# app.aws_sqs_lambda_method = ''
# app.aws_sqs_lambda_region = ''
# app.aws_s3_metadata = ''
# app.aws_s3_license_file = ''
# app.aws_s3_license_version = ''
# app.aws_s3_documents = ''
# app.aws_smtp_username = ''
# app.aws_smtp_password = ''
# app.aws_ses_sender = ''
# app.interested_user_email_list = ''
# app.aws_ses_endpoint = ''
# app.song_price = ''
# app.paypal_mode = ''
# app.paypal_endpoint = ''
# app.paypal_username = ''
# app.paypal_password = ''
client = pymongo.MongoClient(db_url, ssl_cert_reqs=ssl.CERT_NONE, maxPoolSize=None)
app.db = client.get_default_database()
app.register_blueprint(user_routes.users_bp)
app.register_blueprint(user_role_routes.user_roles_bp)
app.register_blueprint(song_routes.songs_bp)
app.register_blueprint(song_artist_routes.songs_artists_bp)
app.register_blueprint(cart_routes.cart_bp)
app.register_blueprint(core_routes.core_bp)
app.register_blueprint(album_routes.albums_bp)
app.register_blueprint(album_artist_routes.albums_artist_bp)
app.register_blueprint(contributor_routes.contributors_bp)
@app.route('/')
def index():
response = {
"message": "Welcome to RAIDAR"
}
return jsonify(response), 200
if __name__ == "__main__":
app.run(host='127.0.0.1', debug=True)