notherbase-fs 1.1.4 → 1.1.8

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
@@ -1,3 +1,5 @@
1
+ require("dotenv").config();
2
+
1
3
  module.exports = {
2
4
  explore: function explore(path) {
3
5
  return `./${path}/${path}.js`;
@@ -1,11 +1,10 @@
1
+ require("dotenv").config();
1
2
  const mongoose = require("mongoose");
2
3
 
3
4
  //connect mongoose and mongo
4
5
  mongoose.connect(process.env.MONGODB_URI, {
5
6
  useNewUrlParser: true,
6
- useUnifiedTopology: true,
7
- useCreateIndex: true,
8
- useFindAndModify: false,
7
+ useUnifiedTopology: true
9
8
  });
10
9
 
11
10
  //handlers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notherbase-fs",
3
- "version": "1.1.4",
3
+ "version": "1.1.8",
4
4
  "description": "Functions to help make developing for NotherBase easier.",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server.js CHANGED
@@ -3,8 +3,6 @@ let theFront, explorer = null;
3
3
 
4
4
  function start() {
5
5
  if (!started) {
6
- require("dotenv").config();
7
-
8
6
  // Setup for Express
9
7
  const express = require("express");
10
8
  const app = express();
@@ -68,7 +66,9 @@ function start() {
68
66
  app.use("/", controllers.authCheck, explorer);
69
67
 
70
68
  // Go Off (On)
71
- server.listen(process.env.PORT);
69
+ server.listen(process.env.PORT, function () {
70
+ console.log(`Server started at ${process.env.PORT}`);
71
+ });
72
72
 
73
73
  started = true;
74
74
  }