diff --git a/.idea/compiler.xml b/.idea/compiler.xml index fcb19bf..b589d56 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 62299b6..6159638 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -4,7 +4,7 @@ - + \ No newline at end of file diff --git a/src/main/java/tech/nevets/vcardgen/Main.java b/src/main/java/tech/nevets/vcardgen/Main.java index 68df83c..b0375db 100644 --- a/src/main/java/tech/nevets/vcardgen/Main.java +++ b/src/main/java/tech/nevets/vcardgen/Main.java @@ -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); diff --git a/src/main/resources/locations.json b/src/main/resources/locations.json new file mode 100644 index 0000000..549a14c --- /dev/null +++ b/src/main/resources/locations.json @@ -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" + } + } + ] +} \ No newline at end of file