Skip to content

Simple Static File server with config. Inspired from Vercel.

License

Notifications You must be signed in to change notification settings

nipeharefa/gitu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Simple Static File server with config. Inspired from Vercel.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published