notherbase-fs 1.1.6 → 1.1.10

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.
@@ -50,10 +50,10 @@ let complete = function complete(explorerBuild) {
50
50
  });
51
51
 
52
52
  detail.options.main = "index";
53
- if (detail.route !== "") detail.options.main = detail.route;
53
+ if (detail.name !== "") detail.options.main = detail.name;
54
54
  detail.options.main = `${currentDir}/views/${detail.options.main}`;
55
55
 
56
- router.get(`${currentDir}/${detail.route}`, async function(req, res) {
56
+ router.get(`${currentDir}/${detail.name}`, async function(req, res) {
57
57
  try {
58
58
  const foundInventory = await inventory.findOne({ user: req.session.currentUser }).populate("items.item");
59
59
 
@@ -27,10 +27,10 @@ let front = function front(detail) {
27
27
  });
28
28
 
29
29
  detail.options.main = "index";
30
- if (detail.route !== "") detail.options.main = detail.route;
30
+ if (detail.name !== "") detail.options.main = detail.name;
31
31
  detail.options.main = `${dir}/views/${detail.options.main}`;
32
32
 
33
- router.get(`/${detail.route}`, async function(req, res) {
33
+ router.get(`/${detail.name}`, async function(req, res) {
34
34
  try {
35
35
  const foundInventory = await inventory.findOne({ user: req.session.currentUser }).populate("items.item");
36
36
 
package/index.js CHANGED
@@ -6,7 +6,7 @@ module.exports = {
6
6
  },
7
7
  data: require("./models"),
8
8
  chat: null,
9
- start: function (world) {
9
+ start: function start(world) {
10
10
  let theFront = require("./controllers/the-front");
11
11
  let explorer = require("./controllers/explorer");
12
12
 
@@ -4,9 +4,7 @@ const mongoose = require("mongoose");
4
4
  //connect mongoose and mongo
5
5
  mongoose.connect(process.env.MONGODB_URI, {
6
6
  useNewUrlParser: true,
7
- useUnifiedTopology: true,
8
- useCreateIndex: true,
9
- useFindAndModify: false,
7
+ useUnifiedTopology: true
10
8
  });
11
9
 
12
10
  //handlers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notherbase-fs",
3
- "version": "1.1.6",
3
+ "version": "1.1.10",
4
4
  "description": "Functions to help make developing for NotherBase easier.",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server.js CHANGED
@@ -1,7 +1,6 @@
1
1
  let started = false;
2
- let theFront, explorer = null;
3
2
 
4
- function start() {
3
+ module.exports = function start(frontRouter, exploreRouter) {
5
4
  if (!started) {
6
5
  // Setup for Express
7
6
  const express = require("express");
@@ -61,21 +60,16 @@ function start() {
61
60
 
62
61
  app.use("/item", controllers.item);
63
62
 
64
- app.use("/the-front", theFront);
63
+ app.use("/the-front", frontRouter);
65
64
 
66
- app.use("/", controllers.authCheck, explorer);
65
+ app.use("/", controllers.authCheck, exploreRouter);
67
66
 
68
67
  // Go Off (On)
69
- server.listen(process.env.PORT);
70
-
68
+ server.listen(process.env.PORT, function () {
69
+ console.log(`Server started at ${process.env.PORT}`);
70
+ });
71
+
71
72
  started = true;
72
73
  }
73
74
  else console.log("Server already started!");
74
- }
75
-
76
- module.exports = function set(frontRouter, exploreRouter) {
77
- theFront = frontRouter;
78
- explorer = exploreRouter;
79
-
80
- return start;
81
75
  }