creationix / weblit

A web framework for luvit 2.0 and lit
MIT License
110 stars 24 forks source link

added redirect if fails to find static file. #23

Closed EngrShahria closed 3 years ago

EngrShahria commented 3 years ago

This is most likely a quality of Life update.

Sometimes, we don't want people to see what files we have inside our static folder, for that reason, we must have a redirect to a different page, let's say index path or a 404 page. Now, you are able to do it easily.

local static = require("weblit-static")
static("path/to/files/", "/") -- "/" will be redirected to, if requests to a static folder