Skip to content

Commit 7cbb6a8

Browse files
Add Svelte to guide (#6269)
Added a guide on proxying to a Svelte app since there wasn't one already. Used the vue and angular guides as a template and included a link to an issue post on sveltekits website which adds some context.
1 parent 7fb5407 commit 7cbb6a8

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docs/guide.md

+22
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- [Proxying to create a React app](#proxying-to-create-a-react-app)
2020
- [Proxying to a Vue app](#proxying-to-a-vue-app)
2121
- [Proxying to an Angular app](#proxying-to-an-angular-app)
22+
- [Proxying to a Svelte app](#proxying-to-a-svelte-app)
2223
- [SSH into code-server on VS Code](#ssh-into-code-server-on-vs-code)
2324
- [Option 1: cloudflared tunnel](#option-1-cloudflared-tunnel)
2425
- [Option 2: ngrok tunnel](#option-2-ngrok-tunnel)
@@ -414,6 +415,27 @@ In order to use code-server's built-in proxy with Angular, you need to make the
414415

415416
For additional context, see [this GitHub Discussion](https://github.com/coder/code-server/discussions/5439#discussioncomment-3371983).
416417

418+
### Proxying to a Svelte app
419+
420+
In order to use code-server's built-in proxy with Svelte, you need to make the following changes in your app:
421+
422+
1. Add `svelte.config.js` if you don't already have one
423+
2. Update the values to match this (you can use any free port):
424+
425+
```js
426+
const config = {
427+
kit: {
428+
paths: {
429+
base: "/absproxy/5173",
430+
},
431+
},
432+
}
433+
```
434+
435+
3. Access app at `<code-server-root>/absproxy/5173/` e.g. `http://localhost:8080/absproxy/5173/
436+
437+
For additional context, see [this Github Issue](https://github.com/sveltejs/kit/issues/2958)
438+
417439
## SSH into code-server on VS Code
418440

419441
[![SSH](https://img.shields.io/badge/SSH-363636?style=for-the-badge&logo=GNU+Bash&logoColor=ffffff)](https://ohmyz.sh/) [![Terminal](https://img.shields.io/badge/Terminal-2E2E2E?style=for-the-badge&logo=Windows+Terminal&logoColor=ffffff)](https://img.shields.io/badge/Terminal-2E2E2E?style=for-the-badge&logo=Windows+Terminal&logoColor=ffffff) [![Visual Studio Code](https://img.shields.io/badge/Visual_Studio_Code-007ACC?style=for-the-badge&logo=Visual+Studio+Code&logoColor=ffffff)](vscode:extension/ms-vscode-remote.remote-ssh)

0 commit comments

Comments
 (0)