https://github.com/nipeharefa/gitu
Simple Static File server with config. Inspired from Vercel.
https://github.com/nipeharefa/gitu
golang static-file static-server
Last synced: 3 months ago
JSON representation
Simple Static File server with config. Inspired from Vercel.
- Host: GitHub
- URL: https://github.com/nipeharefa/gitu
- Owner: nipeharefa
- License: mit
- Created: 2021-02-27T17:08:40.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-25T09:22:06.000Z (about 5 years ago)
- Last Synced: 2025-10-27T21:54:24.242Z (6 months ago)
- Topics: golang, static-file, static-server
- Language: Go
- Homepage:
- Size: 10.7 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Gitu
====
Simple Static File server with config, inspired from Vercel. With gitu you can configure cache, add custome header and redirect like rules in another platform like firebase, vercel, and other.
## Getting Started
## Using Docker
```
FROM alpine:3.10
WORKDIR /app
# USER apps
RUN mkdir static
COPY --from=docker.io/nipeharefa/gitu:0.0.6 /app/main main
COPY --from=builder /app/build ./static/
COPY now.json now.json
CMD [ "/app/main" ]
```
### Example
Create static directory, and create static content
```
mkdir static && cd static
touch index.html
mkdir css jss
touch css/index.css
```
Create new file configuration
```
touch now.json
```
and add simple config to file
```
{
"routes": [
{
"src": "/",
"headers": {
"cache-control": "no-cache"
}
},
{
"src": "/(js|css)/",
"headers": {
"cache-control": "public, s-maxage=15552000, max-age=15552000, must-revalidate"
}
},
{
"src": "/(.*)",
"rewrite": "/"
}
]
}
```
and run gitu
```
gitu
```