Comments (7)
Could you give some more information you have in mind for this idea? An example?
How would this search work? How would the result be printed?
from caddy.
Here's what I was thinking:
- At startup, the middleware launches a service goroutine that runs for the lifetime of the server. Initially it creates an index of the site... presumably in memory, although there are good packages for lightweight persistent data stores available too.
- Periodically the service function re-indexes.
- An endpoint is "exposed" (meaning that a request to a certain URL would be handled by the search middleware and not passed onto other handlers) such as /search (customizable). A GET request here with a "q" parameter would perform a search.
- The search results would be rendered by a template specified by the user (or perhaps a default template), similar to the browse middleware.
- The search endpoint could also be exposed as a JSON API
from caddy.
Ok, got everything.
I'll try work something out.
from caddy.
Awesome! You got it. This is something that would make a great addition to any site.
There is a pretty popular indexing library called bleve that would be worth looking into.
Also, for the record, it will be important to be able to specify a base path to index, but also make it possible to exclude paths from being indexed, for example, if part of the site is a dynamic PHP site or something - no point in indexing PHP source files.
from caddy.
Yay, this is done! \o/ Thanks @pedronasser
from caddy.
@mholt what's about this functionnality? Which directive should I use to have a search bar in my website and a /search endpoint?
from caddy.
@blankoworld I think it was https://github.com/pedronasser/caddy-search, but it doesn't seem supported anymore as far as I can tell. It's not in the official list of plugins anymore
from caddy.
Related Issues (20)
- Certificate renewal checks only using ipv6 dns even if it times out. HOT 6
- Proxy protocol v2, as declared in reverse_proxy / transport http, fails due to unitialized command byte
- In memory cookie jar for http01 challenge HOT 8
- Http keep alive on http01 challenge HOT 1
- Caddy using an incredible amount of cpu out of nowhere HOT 2
- reverse proxy multiple web servers HOT 1
- Problem with proxy rpc over http HOT 5
- Multiple header values on the same field HOT 1
- Feature request: "Set-Cookie" manipulation in the response HOT 10
- binding to an interface explicite is not possible multiple times HOT 2
- Memory leaks HOT 7
- pflag error when compiling -> bad result slice HOT 2
- Inquiry on Using Starlark Scripting with Caddy HOT 4
- caddytls: tailscale cert manager not used as fallback for *.ts.net certs HOT 9
- reverseproxy: feature request: certificate pinning for use with tls_insecure_skip_verify HOT 1
- all: Support the riscv64 platform HOT 3
- Improve error message when trying to define a global matcher HOT 3
- Issue with Caddy Server Configuration for Domain HOT 1
- v2.8.0-rc.1: panic: runtime error: invalid memory address or nil pointer dereference HOT 5
- Intermediate certificate expired without using specified root certificate HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from caddy.