Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Make plenti a caddy plugin #276

Open
diyism opened this issue Mar 7, 2023 · 2 comments
Open

[Feature Request] Make plenti a caddy plugin #276

diyism opened this issue Mar 7, 2023 · 2 comments

Comments

@diyism
Copy link

diyism commented Mar 7, 2023

I rely on the two caddy plugins of https://github.com/caddy-dns/cloudflare and https://github.com/klzgrad/forwardproxy/tree/naive/ currently,
so I can't leave the caddy ecosystem,
but I very much yearn for the functionality of dynamic scripts and Svelte templates for the web server (caddyserver/caddy#2690),
is there any way to integrate the plenti into the caddy server?

@jimafisk
Copy link
Member

jimafisk commented Mar 8, 2023

Hi @diyism, that's an interesting concept, are you mainly looking to compile Svelte components in Go directly? I mean you could always point Caddy at the built assets that Plenti produces (we're actually evaluating Caddy for a hosted Plenti service), but it doesn't sound like that's what you're looking to do in this case? I guess I don't fully understand what it would look like to build a custom website using a Caddy plugin, but would enjoy being enlightened if you have ideas. Thanks!

@diyism
Copy link
Author

diyism commented Mar 9, 2023

I see that when I run "./plenti serve" it needs 2 seconds to build the files in the "public" directory.

I can't find an example plugin that I want for Caddy web server,

but there's a standalone project "algernon" (https://github.com/xyproto/algernon),
after I run "./welcome.sh", I can modify the file of "algernon/samples/greetings/index.md",
and immediately the content changed in the web page of "http://localhost:3000/greetings/",
it's amazing.

but what a pity:

  1. algernon doesn't support svelte files, (Integrate pure-go Svelte compiler just like plenti xyproto/algernon#125)
  2. algernon is not a caddy plugin, I need to forward traffic from the caddy to algernon's 127.0.0.1:3000 port.

so, I'm dreaming:

  1. Plenti can realize the realtime-rendering function for svelte files(for example "index.svelte")
  2. Plenti is a caddy plugin, I need only start the caddy server to avoid the traffic forwarding and a seperate process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants