-
Notifications
You must be signed in to change notification settings - Fork 9
/
app.ts
32 lines (26 loc) · 969 Bytes
/
app.ts
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
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import express from "express";
import cors from "cors";
import manifest from "./services/manifest";
import { tileManifest } from "./services/tiles-v2";
import { vectorsManifest } from "./services/vectors-v2";
import { osm } from "./services/osm";
import path from "path";
const app = express();
const port = 8080;
app.use(cors());
app.use("/vectors/data", express.static("public/vectors/data"));
app.use("/tiles/data", express.static("public/tiles/data"));
app.get("/", function (req, res) {
res.sendFile(path.join(__dirname, "public/demo.html"));
});
app.get("/manifest.json", (req, res) => res.json(manifest));
app.get("/tiles/v2.json", (req, res) => res.json(tileManifest));
app.get("/tiles/osm.json", (req, res) => res.json(osm));
app.get("/vectors/v2.json", (req, res) => res.json(vectorsManifest));
app.listen(port, () => {
console.log("Maps server start running");
});