This commit is contained in:
2020-03-19 12:52:24 +01:00
parent 8e7f3a556e
commit 1b9d0decfd
14 changed files with 666 additions and 50 deletions

View File

@@ -1,38 +0,0 @@
from flask import Flask
import requests
app = Flask(__name__)
URL = "http://server-check"
@app.errorhandler(404)
def page_not_found(error):
return "beppe's 404 error"
@app.route('/')
def doRequest():
return "it works"
@app.route('/server-a')
def checkThis():
return "server-a is apparently something to worry abt"
@app.route("/server-a/check")
def itAlsoWorks():
return requests.get(URL).json()
@app.route('/check')
def itWorks():
return requests.get(URL).json()
@app.route('/text')
def hope():
return requests.get(URL).text
@app.route('/find/<name>/<port>')
def findServer(name, port):
return requests.get("http://"+name+":"+port)
if __name__ == '__main__':
app.run(debug=True, host="0.0.0.0", port=80)

View File

@@ -1,10 +0,0 @@
from python:3.7-alpine
copy . /app
workdir /app
run pip install -r requirements.txt
expose 80
entrypoint [ "python" ]
cmd [ "app.py" ]

View File

@@ -0,0 +1,14 @@
package com.stage.frontend.frontend;
import org.springframework.boot.autoconfigure.*;
import org.springframework.boot.*;
@SpringBootApplication
public class FrontendApplication {
public static void main(String[] args) {
SpringApplication.run(FrontendApplication.class, args);
}
}

View File

@@ -0,0 +1,14 @@
package com.stage.frontend.frontend;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class SimpleRestController {
@RequestMapping("/")
public String index() {
return "it works";
}
}

View File

@@ -0,0 +1 @@

View File

@@ -1,2 +0,0 @@
Flask
requests

View File

@@ -0,0 +1,13 @@
package com.stage.frontend.frontend;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class FrontendApplicationTests {
@Test
void contextLoads() {
}
}