Skip to content

Commit

Permalink
Merge pull request #30 from misterzik/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
misterzik authored Jun 24, 2023
2 parents 1866c3a + df6d4b1 commit 2bfc477
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@misterzik/espressojs",
"version": "3.2.2",
"version": "3.2.3",
"description": "EspressoJS Introducing Espresso.JS, your ultimate Express configuration starting point and boilerplate. With its simplicity and lack of opinionation, EspressoJS offers plug-and-play configurations built on top of Express.",
"main": "index.js",
"scripts": {
Expand Down
6 changes: 5 additions & 1 deletion routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const api = require(path.join(rootDir, "routes", "api.js"));
const db = require(path.join(rootDir, "routes", "db.js"));

module.exports = (app) => {
app.get("/*", function (req, res) {
app.get("/", function (req, res) {
const filePath = path.join(rootDir, "public", "index.html");
res.sendFile(filePath);
});
Expand All @@ -26,6 +26,10 @@ module.exports = (app) => {
if (configuration.mongo_isEnabled === true) {
app.use("/api", db);
}
app.get("/*", function (req, res) {
const filePath = path.join(rootDir, "public", "index.html");
res.sendFile(filePath);
});
app.use(function (req, res, next) {
res.status(404).send("404 - Sorry can't find that!");
});
Expand Down

0 comments on commit 2bfc477

Please sign in to comment.