mirror of
https://gitea.smigz.com/smiggiddy/odin-codeprojects.git
synced 2025-04-04 19:10:56 -04:00
added dockerfile
This commit is contained in:
parent
15a77883f4
commit
eb3068af96
4 changed files with 23 additions and 1 deletions
13
nodejs-mini-message-board/Dockerfile
Normal file
13
nodejs-mini-message-board/Dockerfile
Normal file
|
@ -0,0 +1,13 @@
|
|||
FROM node:23-alpine
|
||||
|
||||
COPY . /app
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN npm install .
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["node", "src/app.js"]
|
||||
|
||||
|
3
nodejs-mini-message-board/src/.dockerignore
Normal file
3
nodejs-mini-message-board/src/.dockerignore
Normal file
|
@ -0,0 +1,3 @@
|
|||
node_modules/
|
||||
Dockerfile
|
||||
package-lock.json
|
|
@ -13,6 +13,8 @@ app.set("view engine", "ejs");
|
|||
const assetsPath = path.join(__dirname, "public");
|
||||
app.use(express.static(assetsPath));
|
||||
|
||||
app.use(express.urlencoded({ extended: true }));
|
||||
|
||||
app.use("/", indexRouter);
|
||||
//app.use("/new", msgRouter);
|
||||
|
||||
|
|
|
@ -34,7 +34,11 @@ indexRouter.get("/new", (req, res) => {
|
|||
});
|
||||
|
||||
indexRouter.post("/new", (req, res) => {
|
||||
console.log(req);
|
||||
messages.unshift({
|
||||
text: req.body.message,
|
||||
user: req.body.username,
|
||||
added: new Date(),
|
||||
});
|
||||
res.redirect("/");
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue