-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fde13b9
commit 280cfcb
Showing
1 changed file
with
39 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,50 @@ | ||
# Go Gin Web Page Renderer | ||
# Grender - Web Page Renderer | ||
|
||
❗ __Warning: This project is in a very early stage of development.__ | ||
❗ **This project is in a very early stage of development.** ❗ | ||
|
||
This repository contains a simple Go web application built with Gin that renders web pages using headless Chrome through the chromedp library. The rendered HTML content is then returned as the response to the client. | ||
This is a Go-based rendering server. It uses different backends for storage and is configured via a YAML file. | ||
|
||
## Prerequisites | ||
## Configuration | ||
|
||
Before running the application, make sure you have the following dependencies installed: | ||
The server is configured using a `config.yaml` file. Here's an example: | ||
|
||
- [Go](https://golang.org/dl/) | ||
- [chromedp](https://pkg.go.dev/github.com/chromedp/chromedp) | ||
- [Gin](https://pkg.go.dev/github.com/gin-gonic/gin) | ||
```yaml | ||
version: v1 | ||
renderingConfig: | ||
pageWaitTime: 1000 | ||
pageWaitCondition: '(function() { return window.prerenderReady === true })()' | ||
server: | ||
port: "8080" | ||
backend: | ||
s3: | ||
bucketName: "grender.io" | ||
region: "ap-southeast-2" | ||
|
||
You can install the Go dependencies using `go get`: | ||
``` | ||
|
||
## Running the Server | ||
|
||
To run the server, use the following command: | ||
|
||
```bash | ||
go run main.go | ||
``` | ||
|
||
Make sure to have your config.yaml file in the same directory where you run this command. | ||
|
||
```bash | ||
go get -u github.com/chromedp/chromedp | ||
go get -u github.com/gin-gonic/gin | ||
``` | ||
|
||
## Project Structure | ||
|
||
The main components of the project are organized into packages: | ||
|
||
- **pilot:** Contains the main Grender application files, including configuration, rendering logic, and server setup. | ||
- **backend:** Provides interfaces and implementations for different backends, such as S3 and file systems. | ||
- **render:** Implements the rendering logic using a headless Chrome browser. | ||
|
||
## Dependencies | ||
|
||
Grender relies on third-party packages for AWS S3 integration, YAML parsing, and headless Chrome browser automation. |