forked from Azure-Samples/python-docs-hello-world
-
Notifications
You must be signed in to change notification settings - Fork 0
/
application.py
43 lines (34 loc) · 1.69 KB
/
application.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
import os
from flask import Flask,redirect
import sys
import urllib.request
version = os.environ['version']
app = Flask(__name__)
@app.route('/latest/online-win/')
def winonline():
target_url = "https://vscjavaci.blob.core.windows.net/vscodejavainstaller/latest/VSCodeJavaInstaller-online-win-%s.exe"%version
return redirect(target_url, code=302)
@app.route('/latest/win-x64-jdk8/')
def jdk8winx64():
target_url = "https://vscjavaci.blob.core.windows.net/vscodejavainstaller/latest/VSCodeJava8Installer-win-x64-%s.exe"%version
return redirect(target_url, code=302)
@app.route('/latest/win-x64-jdk11/')
def jdk11winx64():
target_url = "https://vscjavaci.blob.core.windows.net/vscodejavainstaller/latest/VSCodeJava11Installer-win-x64-%s.exe"%version
return redirect(target_url, code=302)
@app.route('/latest/win-x64-jdk12/')
def jdk12winx64():
target_url = "https://vscjavaci.blob.core.windows.net/vscodejavainstaller/latest/VSCodeJava12Installer-win-x64-%s.exe"%version
return redirect(target_url, code=302)
@app.route('/latest/win-x86-jdk8/')
def jdk8winx86():
target_url = "https://vscjavaci.blob.core.windows.net/vscodejavainstaller/latest/VSCodeJava8Installer-win-x86-%s.exe"%version
return redirect(target_url, code=302)
@app.route('/latest/win-x86-jdk11/')
def jdk11winx86():
target_url = "https://vscjavaci.blob.core.windows.net/vscodejavainstaller/latest/VSCodeJava11Installer-win-x86-%s.exe"%version
return redirect(target_url, code=302)
@app.route('/latest/win-x86-jdk12/')
def jdk12winx86():
target_url = "https://vscjavaci.blob.core.windows.net/vscodejavainstaller/latest/VSCodeJava12Installer-win-x86-%s.exe"%version
return redirect(target_url, code=302)