Skip to content

Commit

Permalink
create a vscode tasks file to start the PHP builtin server
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRDOrazio committed Nov 17, 2024
1 parent e71aa69 commit 5ee55f0
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "launch-browser",
"type": "shell",
"windows": {
"command": "${command:workbench.action.terminal.sendSequence}",
"args": [
{
"text": "start http://localhost:8000\n" // For Windows
}
],
"problemMatcher": []
},
"linux": {
"command": "/bin/bash",
"args": [
"-c",
"if grep -q microsoft /proc/version; then powershell.exe Start-Process http://localhost:8000; else xdg-open http://localhost:8000; fi"
],
"problemMatcher": []
},
"osx": {
"command": "open http://localhost:8000", // For macOS
"problemMatcher": []
}
},
{
"label": "php-server",
"type": "shell",
"command": "PHP_CLI_SERVER_WORKERS=2 php -S localhost:8000",
"group": {
"kind": "build",
"isDefault": true
},
"dependsOn": [
"launch-browser"
]
}
]
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ Spawn at least two workers:
PHP_CLI_SERVER_WORKERS=2 php -S localhost:8000
```

For convenience when using VSCode, a `tasks.json` has been defined so that you can simply type <kbd>CTRL</kbd>+<kbd>SHIFT</kbd>+<kbd>B</kbd> (<kbd>CMD</kbd>+<kbd>SHIFT</kbd>+<kbd>B</kbd> on MacOS) to start the PHP builtin server and open the browser.

# Translations

<a href="https://translate.johnromanodorazio.com/engage/liturgical-calendar/">
Expand Down

0 comments on commit 5ee55f0

Please sign in to comment.