mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-09 16:33:58 +08:00
Add support for Codespaces (#3432)
* Create devcontainer.json * WIP * WIP * WIP * Create README.md * Try to fix cypress issue * Add extensions * WIP * Minor
This commit is contained in:
26
.devcontainer/README.md
Normal file
26
.devcontainer/README.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# Codespaces
|
||||
|
||||
Now you can modifiy Uptime Kuma on your browser without setting up a local development.
|
||||
|
||||

|
||||
|
||||
1. Click `Code` -> `Create codespace on master`
|
||||
2. Wait a few minutes until you see there are two exposed ports
|
||||
3. Go to the `3000` url, see if it is working
|
||||
|
||||

|
||||
|
||||
## Frontend
|
||||
|
||||
Since it is using Vite.js, all frontend changes will be hot-reloaded. You don't need to restart the frontend, unless you try to add a new frontend dependency.
|
||||
|
||||
## Restart Backend
|
||||
|
||||
Sometimes you need to restart the backend after changed something.
|
||||
|
||||
1. Click `Terminal`
|
||||
1. Click `Codespaces: server-dev` in the right panel
|
||||
1. Press `Ctrl + C` to stop the server
|
||||
2. Press `Up` to run `npm run start-server-dev`
|
||||
|
||||

|
23
.devcontainer/devcontainer.json
Normal file
23
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"image": "mcr.microsoft.com/devcontainers/javascript-node:dev-20-bookworm",
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/github-cli:1": {}
|
||||
},
|
||||
"updateContentCommand": "npm ci",
|
||||
"postCreateCommand": "",
|
||||
"postAttachCommand": {
|
||||
"frontend-dev": "npm run start-frontend-devcontainer",
|
||||
"server-dev": "npm run start-server-dev",
|
||||
"open-port": "gh codespace ports visibility 3001:public -c $CODESPACE_NAME"
|
||||
},
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"streetsidesoftware.code-spell-checker",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"GitHub.copilot"
|
||||
]
|
||||
}
|
||||
},
|
||||
"forwardPorts": [3000, 3001]
|
||||
}
|
Reference in New Issue
Block a user