notherbase-fs 1.2.14 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/controllers/explorer.js +93 -130
- package/controllers/game.js +2 -1
- package/controllers/inventory.js +9 -5
- package/controllers/item.js +24 -14
- package/controllers/the-front.js +73 -91
- package/models/index.js +2 -1
- package/models/poi.js +18 -0
- package/notherbase-fs.js +87 -0
- package/package.json +2 -2
- package/test/coast/tall-beach/nono-cove/local-scripts/items.js +162 -0
- package/test/coast/tall-beach/nono-cove/local-scripts/nono.js +2 -5
- package/test/coast/tall-beach/nono-cove/server-scripts/addToTimer.js +34 -0
- package/test/coast/tall-beach/nono-cove/server-scripts/getTimer.js +31 -0
- package/test/coast/tall-beach/nono-cove/styles/items-floor.css +92 -0
- package/test/coast/tall-beach/nono-cove/views/index.ejs +93 -5
- package/test/coast/tall-beach/nono-cove/views/nono-og.ejs +6 -0
- package/test/test-index.js +2 -64
- package/test/views/check.ejs +7 -0
- package/test/views/index.ejs +4 -0
- package/views/explorer.ejs +0 -29
- package/views/inventory.ejs +12 -7
- package/index.js +0 -22
- package/server.js +0 -83
package/server.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
let started = false;
|
|
2
|
-
|
|
3
|
-
module.exports = function start(frontRouter, exploreRouter, pagesRouter, dbConnected) {
|
|
4
|
-
if (!started) {
|
|
5
|
-
// Setup for Express
|
|
6
|
-
const express = require("express");
|
|
7
|
-
const app = express();
|
|
8
|
-
app.set("view engine", "ejs");
|
|
9
|
-
app.set("views", `${__dirname}/views`);
|
|
10
|
-
|
|
11
|
-
//setup for sockets
|
|
12
|
-
const http = require('http');
|
|
13
|
-
const server = http.createServer(app);
|
|
14
|
-
const { Server } = require("socket.io");
|
|
15
|
-
const io = new Server(server);
|
|
16
|
-
|
|
17
|
-
// allows us to delete
|
|
18
|
-
const methodOverride = require('method-override');
|
|
19
|
-
app.use(methodOverride('_method'));
|
|
20
|
-
|
|
21
|
-
//auth
|
|
22
|
-
const session = require('express-session');
|
|
23
|
-
const MongoStore = require('connect-mongo');
|
|
24
|
-
|
|
25
|
-
// allows us to use post body data
|
|
26
|
-
app.use(express.urlencoded({ extended: true }));
|
|
27
|
-
|
|
28
|
-
// allows us to get static files like css
|
|
29
|
-
app.use(express.static('public'));
|
|
30
|
-
app.use(express.static(`${__dirname}/public`));
|
|
31
|
-
|
|
32
|
-
// sets the favicon image
|
|
33
|
-
const favicon = require('serve-favicon');
|
|
34
|
-
app.use(favicon(__dirname + '/public/img/logo.png'));
|
|
35
|
-
|
|
36
|
-
// Import my Controller
|
|
37
|
-
const controllers = require("./controllers");
|
|
38
|
-
|
|
39
|
-
//enable cookies
|
|
40
|
-
if (dbConnected) {
|
|
41
|
-
app.use(session({
|
|
42
|
-
store: MongoStore.create({ mongoUrl: process.env.MONGODB_URI }),
|
|
43
|
-
secret: process.env.SECRET || "won",
|
|
44
|
-
resave: false,
|
|
45
|
-
saveUninitialized: false
|
|
46
|
-
}));
|
|
47
|
-
|
|
48
|
-
console.log("sessions enabled");
|
|
49
|
-
}
|
|
50
|
-
else console.log("sessions disabled");
|
|
51
|
-
|
|
52
|
-
io.on('connection', (socket) => {
|
|
53
|
-
socket.join(socket.handshake.query.room);
|
|
54
|
-
|
|
55
|
-
socket.on('disconnect', () => {});
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
app.use("/user", controllers.user);
|
|
59
|
-
|
|
60
|
-
app.use("/chat", controllers.chat(io));
|
|
61
|
-
|
|
62
|
-
app.use("/contact", controllers.contact);
|
|
63
|
-
|
|
64
|
-
app.use("/game", controllers.game);
|
|
65
|
-
|
|
66
|
-
app.use("/inventory", controllers.inventory);
|
|
67
|
-
|
|
68
|
-
app.use("/item", controllers.item);
|
|
69
|
-
|
|
70
|
-
app.use("/the-front", frontRouter);
|
|
71
|
-
|
|
72
|
-
app.use("/", pagesRouter);
|
|
73
|
-
|
|
74
|
-
app.use("/", controllers.authCheck, exploreRouter);
|
|
75
|
-
|
|
76
|
-
server.listen(process.env.PORT, function () {
|
|
77
|
-
console.log(`Server started at ${process.env.PORT}`);
|
|
78
|
-
started = true;
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
else console.log("Server already started!");
|
|
83
|
-
}
|