Compare commits

8 Commits
run ... main

Author SHA1 Message Date
7538d5ea59 Update README.md 2025-01-31 11:38:36 +01:00
Dieter Blocher
4ba3fcea08 Add example.env 2025-01-31 08:23:55 +00:00
Dieter Blocher
b73e655e89 Update stuff 2025-01-30 16:42:28 +00:00
71e3adf351 Update .devcontainer/devcontainer.json 2025-01-30 17:31:04 +01:00
bc8f30e924 Update .devcontainer/Dockerfile 2025-01-30 17:30:42 +01:00
2ed058df64 Update .devcontainer/devcontainer.json 2025-01-30 17:23:27 +01:00
7cc5200f24 Update README.md 2025-01-30 17:17:05 +01:00
1e74de1393 Update doc/README.md 2025-01-30 16:46:14 +01:00
6 changed files with 31 additions and 22 deletions

View File

@@ -2,6 +2,10 @@ FROM mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm
# Copy the Sophos CA certificate into the container # Copy the Sophos CA certificate into the container
COPY sophos.crt /usr/local/share/ca-certificates/sophos.crt COPY sophos.crt /usr/local/share/ca-certificates/sophos.crt
COPY mitutoyo.crt /usr/local/share/ca-certificates/mitutoyo.crt COPY mitutoyo.crt /usr/local/share/ca-certificates/mitutoyo.crt
# Merge multiple CA certificates into one file
RUN cat /usr/local/share/ca-certificates/sophos.crt \
/usr/local/share/ca-certificates/mitutoyo.crt \
> /usr/local/share/ca-certificates/custom-ca.pem
# Update system CA certificates # Update system CA certificates
RUN update-ca-certificates RUN update-ca-certificates
# Install MongoDB command line tools - though mongo-database-tools not available on arm64 # Install MongoDB command line tools - though mongo-database-tools not available on arm64

View File

@@ -8,7 +8,7 @@
// Features to add to the dev container. More info: https://containers.dev/features. // Features to add to the dev container. More info: https://containers.dev/features.
// "features": {}, // "features": {},
"containerEnv": { "containerEnv": {
"NODE_EXTRA_CA_CERTS": "/usr/local/share/ca-certificates/sophos.crt" "NODE_EXTRA_CA_CERTS": "/usr/local/share/ca-certificates/custom-ca.pem"
}, },
// Configure tool-specific properties. // Configure tool-specific properties.
"customizations": { "customizations": {

View File

@@ -1,20 +1,3 @@
# test_dev # test_dev
From here: Repo has moved to: https://gitea.not-my.cloud/education/hacker-game
https://www.youtube.com/watch?v=SDa3v4Quj7Y
Auth:
https://www.youtube.com/watch?v=bgk1mI2pak4
Middelware:
https://www.youtube.com/watch?v=_I6gP_nIFIA
Passport-js
https://www.youtube.com/watch?v=-RCnNyD0L-s
# Certificate
The Container need our certificate! -> Check if this works now?
# Documentation
[Documentation](./doc/README.md)

View File

@@ -20,7 +20,16 @@ Now you are able to open a new terminal:
![alt text](./assets/new_terminal.png) ![alt text](./assets/new_terminal.png)
# Start the Server: # Install packages
First you should install all related packages with
```npm install```
This will install the packages defined in [package.json](../package.json)
# Start the Server
```npm run devStart``` or ```npx nodemon``` ```npm run devStart``` or ```npx nodemon```
![alt text](./assets/start_node_server.png) ![alt text](./assets/start_node_server.png)
@@ -30,3 +39,13 @@ or
![alt text](./assets/start_node_server2.png) ![alt text](./assets/start_node_server2.png)
the second method uses the [nodemon.json](../nodemon.json) to configure nodemon. the second method uses the [nodemon.json](../nodemon.json) to configure nodemon.
# .env file
To have different behavior on your dev host, you cloud add an .env file.
Here are the key-values of an .evc file:
```bash
PORT = 3000
```

2
example.env Normal file
View File

@@ -0,0 +1,2 @@
# App Port
PORT = 3000

View File

@@ -33,5 +33,6 @@ app.get('/', (req, res) => {
res.render('index.ejs') res.render('index.ejs')
}) })
const port = process.env.PORT; const port = process.env.PORT || 3000;;
app.listen(port, () => console.log("Server is running on http://localhost:%i", port)); app.listen(port, () => console.log("Server is running on http://localhost:%i", port));