Added backend driven locations
This commit is contained in:
		
							parent
							
								
									85cdb059d4
								
							
						
					
					
						commit
						728092dfed
					
				@ -1,6 +1,6 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project version="4">
 | 
			
		||||
  <component name="CompilerConfiguration">
 | 
			
		||||
    <bytecodeTargetLevel target="18" />
 | 
			
		||||
    <bytecodeTargetLevel target="17" />
 | 
			
		||||
  </component>
 | 
			
		||||
</project>
 | 
			
		||||
@ -4,7 +4,7 @@
 | 
			
		||||
  <component name="FrameworkDetectionExcludesConfiguration">
 | 
			
		||||
    <file type="web" url="file://$PROJECT_DIR$" />
 | 
			
		||||
  </component>
 | 
			
		||||
  <component name="ProjectRootManager" version="2" languageLevel="JDK_18" default="true" project-jdk-name="temurin-18" project-jdk-type="JavaSDK">
 | 
			
		||||
  <component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="temurin-18" project-jdk-type="JavaSDK">
 | 
			
		||||
    <output url="file://$PROJECT_DIR$/out" />
 | 
			
		||||
  </component>
 | 
			
		||||
</project>
 | 
			
		||||
@ -30,8 +30,17 @@ public class Main {
 | 
			
		||||
        get("/heartbeat", (req, res) -> {
 | 
			
		||||
            res.status(200);
 | 
			
		||||
            res.type("application/json");
 | 
			
		||||
            res.header("Access-Control-Allow-Origin", "*");
 | 
			
		||||
            return "{ \"up\":true }";
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        get("/data/locations", (req, res) -> {
 | 
			
		||||
            res.status(200);
 | 
			
		||||
            res.type("application/json");
 | 
			
		||||
            res.header("Access-Control-Allow-Origin", "*");
 | 
			
		||||
            return Main.class.getResourceAsStream("/locations.json");
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        post("/", (req, res) -> {
 | 
			
		||||
            res.type("image/png");
 | 
			
		||||
            JsonObject data = new Gson().fromJson(req.body(), JsonObject.class);
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										25
									
								
								src/main/resources/locations.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								src/main/resources/locations.json
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,25 @@
 | 
			
		||||
{
 | 
			
		||||
  "locations": [
 | 
			
		||||
    {
 | 
			
		||||
      "caiu": {
 | 
			
		||||
        "name": "Capital Area Intermediate Unit",
 | 
			
		||||
        "address": "55 Miller St, Enola, PA, 17025",
 | 
			
		||||
        "phone": "(717)732-8400"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "caelc": {
 | 
			
		||||
        "name": "Capital Area Early Learning Center",
 | 
			
		||||
        "address": "4100 Gettysburg Rd, Camp Hill, PA, 17011",
 | 
			
		||||
        "phone": "(717)732-"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "hta": {
 | 
			
		||||
        "name": "Hill Top Academy",
 | 
			
		||||
        "address": "405 E Winding Hill Rd, Mechanicsburg, PA, 17055",
 | 
			
		||||
        "phone": "(717)732-8484"
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  ]
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user