Skip to content

Commit

Permalink
minor bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kieferhogg committed May 6, 2022
1 parent ad4458f commit 26bf530
Show file tree
Hide file tree
Showing 29 changed files with 2,173 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules
.env
.firebase
node_modules
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cSpell.words": [
"Wordle"
]
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# word-gotchu
Pixel styled web platform game based on Wordle and original characters known as “Gotchus’’ that battle against each other in an arena.
37 changes: 37 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const express = require("express");
const bodyParser = require("body-parser");
const cookieSession = require("cookie-session");

const router = require("./routes/router");
const apiRouter = require("./routes/api")

const app = express();

app.set("view engine", "ejs")
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json())
app.use(cookieSession({
name: 'player',
keys: ['cookieMonsterProtection1', 'cookieMonsterProtection2']
}));
app.use(express.static("public"));

app.use("/", router);
app.use("/api/v1", apiRouter)

// Error Handling
app.use((req, res, next) => {
const error = new Error(`Not Found - ${req.originalUrl}`);
res.status(404);
next(error);
});

app.use((err, req, res, next) => {
const statusCode = res.statusCode === 200 ? 500 : res.statusCode;
res.status(statusCode);
res.json({
message: err.message
})
})

module.exports = app;
Loading

0 comments on commit 26bf530

Please # to comment.