mirror of
https://github.com/bvanroll/stage-frontend.git
synced 2025-08-29 20:12:39 +00:00
hlep
This commit is contained in:
38
src/app.py
38
src/app.py
@@ -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)
|
@@ -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" ]
|
@@ -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);
|
||||
}
|
||||
|
||||
}
|
@@ -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";
|
||||
}
|
||||
}
|
1
src/main/resources/application.properties
Normal file
1
src/main/resources/application.properties
Normal file
@@ -0,0 +1 @@
|
||||
|
@@ -1,2 +0,0 @@
|
||||
Flask
|
||||
requests
|
@@ -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() {
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user