Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7538d5ea59 | |||
|
|
4ba3fcea08 | ||
|
|
b73e655e89 | ||
| 71e3adf351 | |||
| bc8f30e924 | |||
| 2ed058df64 | |||
| 7cc5200f24 | |||
| 1e74de1393 |
@@ -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
|
||||||
|
|||||||
@@ -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": {
|
||||||
|
|||||||
19
README.md
19
README.md
@@ -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)
|
|
||||||
|
|||||||
@@ -20,7 +20,16 @@ Now you are able to open a new terminal:
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
# 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```
|
||||||
|
|
||||||

|

|
||||||
@@ -30,3 +39,13 @@ or
|
|||||||

|

|
||||||
|
|
||||||
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
2
example.env
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# App Port
|
||||||
|
PORT = 3000
|
||||||
@@ -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));
|
||||||
Reference in New Issue
Block a user