-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathapp.py
More file actions
23 lines (17 loc) · 709 Bytes
/
app.py
File metadata and controls
23 lines (17 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from flask import Flask, send_from_directory, request
from tasks import create_development_environment
from flask_cors import CORS, cross_origin
app = Flask(__name__, static_url_path='', static_folder='frontend/build')
CORS(app)
@app.route("/")
def index():
return send_from_directory(app.static_folder,'index.html')
@app.route("/create-dev-environment", methods=["POST"])
@cross_origin()
def create_dev_environment():
email = request.form.get("email")
githubRepoUrl = request.json["githubRepoUrl"]
email = request.json["email"]
access_token = request.json["githubAccessToken"]
create_development_environment.delay(githubRepoUrl, email, access_token)
return {"success": True}