-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.js
More file actions
30 lines (24 loc) · 888 Bytes
/
app.js
File metadata and controls
30 lines (24 loc) · 888 Bytes
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
const express = require("express");
const { port, slurl } = require("./config/config");
const { exec } = require("child_process");
const app = express();
const searchRoutes = require("./routes/search");
const profileInfoRoutes = require("./routes/profile-info");
const strictSearchRoutes = require("./routes/strict-search");
const hashtagRoutes = require("./routes/hashtag");
const usernameLatestRoutes = require("./routes/username-latest");
app.set("view engine", "ejs");
app.use(searchRoutes);
app.use(profileInfoRoutes);
app.use(strictSearchRoutes);
app.use(hashtagRoutes);
app.use(usernameLatestRoutes);
app.get("/", (req, res) => {
res.send(`
<h1>Welcome to the XOpenAPI.</h1>
<p>Get URL generator & examples at <a href="${slurl}" target="_blank">${slurl}</a></p>
`);
});
app.listen(port, () => {
console.log(`Server is running on http://localhost:${port}`);
});