Skip to content

Commit

Permalink
clean up, clean up, everybody everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
Ianyourgod committed Apr 5, 2024
1 parent aae7639 commit 74474b2
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 36 deletions.
25 changes: 1 addition & 24 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,9 @@

# Node
node_modules
package-lock.json

# macOS
.DS_Store

# Windows
System Volume Information

# Database Files
cooldown.json
banned.json
users.json
usermessages.json
userdata.json
userfeed.json
following.json
hadfollowing.json

userreports.json
projectreports.json

# Extra
blockedips.json
globalsettings.json
illegalwords.js
cache/*

# Projects
api/db/projects/*
System Volume Information
File renamed without changes.
File renamed without changes.
15 changes: 5 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const cors = require('cors');
const rateLimit = require('express-rate-limit');
const express = require("express");
const endpointLoader = require("./api/endpointLoader");
const um = require('./api/db/UserManager');
const um = require('./api/v1/db/UserManager');
const cast = require("./utils/Cast");
const path = require('path');
const functions = require('./utils/functions');
Expand All @@ -13,7 +13,7 @@ const app = express();
const PORT = process.env.PORT || 3000;
const MAXVIEWS = process.env.MAXVIEWS || 10000; // it will take up to 10000 views then reset after
const VIEWRESETRATE = process.env.VIEWRESETRATE || 1000 * 60 * 60; // reset every hour
const upload = multer({ dest: 'uploads/' });
const upload = multer({ dest: 'tmp/uploads/' });

app.use(cors({
origin: '*',
Expand All @@ -38,12 +38,6 @@ app.use(rateLimit({
legacyHeaders: false,
}));

function error(res, code, message) {
res.status(code);
res.header("Content-Type", 'application/json');
res.json({ "error": message });
}

const Cast = new cast();
const UserManager = new um();

Expand All @@ -59,8 +53,9 @@ const UserManager = new um();
homeDir: path.join(__dirname, "./"),
Cast: Cast,
escapeXML: functions.escapeXML,
error: error,
env: process.env
error: functions.error,
env: process.env,
upload: upload
});

app.listen(PORT, () => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"scripts": {
"dev": "nodemon index.js",
"reset": "node reset.js",
"test": "node api/db/UMTests.js"
"test": "node api/v1/db/UMTests.js"
}
}
2 changes: 1 addition & 1 deletion reset.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const um = require('./api/db/UserManager');
const um = require('./api/v1/db/UserManager');

const UserManager = new um();

Expand Down

0 comments on commit 74474b2

Please sign in to comment.