-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
38 lines (33 loc) · 829 Bytes
/
index.js
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
33
34
35
36
37
38
const {
MAIN_HTML,
PLACE_HTML,
ASSETLINKS_MOTO,
APPLE_LINKS,
PLACE_PATH,
ASSETLINKS_ROUTE,
APPLE_LINKS_ROUTE,
APPLE_FILE_MOTO,
} = require("./consts.js");
const express = require("express");
const app = express();
const port = 9000;
app.get("/", (req, res) => {
res.type("html").status(200).send(MAIN_HTML);
});
//place page
app.get(PLACE_PATH, (req, res) => {
res.type("html").status(200).send(PLACE_HTML);
});
//adnroid well knowns
app.get(ASSETLINKS_ROUTE, (req, res) => {
res.setHeader("Content-Type", "application/json");
res.status(200).send(ASSETLINKS_MOTO);
});
//apple well knowns
app.get(APPLE_LINKS_ROUTE, (req, res) => {
res.setHeader("Content-Type", "application/json");
res.status(200).send(APPLE_FILE_MOTO);
});
app.listen(port, () => {
console.log(`IT'S OVER ${port} !!!`);
});