mirror of
https://github.com/gosom/google-maps-scraper.git
synced 2026-09-19 07:27:12 +08:00
af155eecb7
This patch adds functionality to automatically provisiomn a webserver that exposes: - a REST API to submit keywords for scraping - a WebUI to automatically workers
29 lines
511 B
Go
29 lines
511 B
Go
package rqueue
|
|
|
|
import (
|
|
"context"
|
|
|
|
"riverqueue.com/riverui"
|
|
|
|
"github.com/gosom/google-maps-scraper/log"
|
|
)
|
|
|
|
func CreateRiverUIHandler(_ context.Context, client *Client) (*riverui.Handler, error) {
|
|
endpoints := riverui.NewEndpoints(client.RiverClient(), nil)
|
|
|
|
logger := log.With("srv", "riverui")
|
|
|
|
opts := &riverui.HandlerOpts{
|
|
Endpoints: endpoints,
|
|
Logger: logger,
|
|
Prefix: "/riverui",
|
|
}
|
|
|
|
handler, err := riverui.NewHandler(opts)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return handler, nil
|
|
}
|