Done for now
This commit is contained in:
parent
152b417d28
commit
fa3be85e5d
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
11
package.json
11
package.json
|
@ -2,15 +2,15 @@
|
|||
"dependencies": {
|
||||
"express": "^4.17.3",
|
||||
"node": "^17.7.2",
|
||||
"pug": "^3.0.2",
|
||||
"request": "^2.81.0",
|
||||
"serve-static": "^1.15.0"
|
||||
},
|
||||
"name": "abuseapi",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"devDependencies": {},
|
||||
"scripts": {
|
||||
"start": "node src/index.js"
|
||||
"start": "node ./src/index.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -19,5 +19,10 @@
|
|||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"description": ""
|
||||
"description": "",
|
||||
"devDependencies": {
|
||||
"connect-livereload": "^0.6.1",
|
||||
"livereload": "^0.9.3",
|
||||
"nodemon": "^2.0.15"
|
||||
}
|
||||
}
|
||||
|
|
32
src/index.js
32
src/index.js
|
@ -1,23 +1,28 @@
|
|||
const search = require("./helpers/API");
|
||||
var serveStatic = require("serve-static");
|
||||
const serveStatic = require("serve-static");
|
||||
const express = require("express");
|
||||
const path = require('path');
|
||||
const router = express.Router();
|
||||
|
||||
|
||||
const app = express();
|
||||
const port = 3000;
|
||||
|
||||
app.use(
|
||||
serveStatic("src/public", {
|
||||
maxAge: "1d",
|
||||
})
|
||||
);
|
||||
app.get("/", (req, res) => {
|
||||
main();
|
||||
app.set("view engine", "pug");
|
||||
app.set("views", path.join(__dirname, "views"));
|
||||
|
||||
const options = {
|
||||
headers: {
|
||||
'Cache-Control': 'no-cache',
|
||||
}
|
||||
};
|
||||
|
||||
//app.use(express.static('./src/public'));
|
||||
app.use("/", router)
|
||||
router.get("/", (req, res) => {
|
||||
res.send(main());
|
||||
});
|
||||
function doCache(res, durationSecs) {
|
||||
res.set({
|
||||
"Cache-Control": "max-age=" + durationSecs,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`listening on port ${port}`);
|
||||
|
@ -26,4 +31,3 @@ app.listen(port, () => {
|
|||
async function main() {
|
||||
search.search();
|
||||
}
|
||||
main();
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<div class="center-screen container">
|
||||
<div class="parent">
|
||||
<div class="imgbox">
|
||||
<img src="assets/waifu.png" class="img-container" />
|
||||
<img src="./assets/waifu.png" class="img-container" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue