Compare commits
8 Commits
81ab5b252b
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 1b6d27da99 | |||
| 87a84d6443 | |||
| fedb515df1 | |||
| 383ba0d831 | |||
| af57f1a49d | |||
| 03af8d61c7 | |||
| e36f5bc579 | |||
| 1e15e20175 |
41
README.md
41
README.md
@@ -1,11 +1,13 @@
|
|||||||
# Fes
|
# Fes
|
||||||
|
|
||||||
A lightweight, static, and opinionated microframework.
|
Fes is an embedded Lua microwebframework for create static, extensible
|
||||||
|
websites. Using file-based routes you can easily strucutre you website just by
|
||||||
|
moving files around. See [fsdproject.org](https://fsdproject.org) for a
|
||||||
|
real-world example.
|
||||||
|
|
||||||
## Usage
|
## A Simple Example
|
||||||
|
|
||||||
This is the `fes new <project>` output
|
|
||||||
```lua
|
```lua
|
||||||
|
-- project/www/index.lua as created from fes new project
|
||||||
local fes = require("fes")
|
local fes = require("fes")
|
||||||
local site = fes.fes()
|
local site = fes.fes()
|
||||||
|
|
||||||
@@ -14,32 +16,9 @@ site:h1("Hello, World!")
|
|||||||
return site
|
return site
|
||||||
```
|
```
|
||||||
|
|
||||||
This can be ran with `fes run <project>` where `<project>` is the location of the website.
|
```
|
||||||
|
$ fes run project
|
||||||
## Examples
|
|
||||||
|
|
||||||
See `examples/` for different features, `canonical/` contains the best practices for this microframework.
|
|
||||||
|
|
||||||
## Build
|
|
||||||
|
|
||||||
```sh
|
|
||||||
git clone https://git.vxserver.dev/fSD/fes.git
|
|
||||||
cd fes
|
|
||||||
|
|
||||||
go build .
|
|
||||||
./fes run examples/hello-world # if this works install
|
|
||||||
|
|
||||||
go install fes
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Documentation
|
## Contributing
|
||||||
|
See [fSD hacking](https://fsdproject.org/hacking) and [fSD community](https://fsdproject.org/community)
|
||||||
Run `fes doc` for the documentation website or goto [docs.vxserver.dev](https://docs.vxserver.dev)
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
ISC License
|
|
||||||
|
|
||||||
Copyright (C) 2025-2026 fSD
|
|
||||||
|
|
||||||
See `COPYING`
|
|
||||||
|
|||||||
@@ -40,7 +40,13 @@ func Start(dir string) {
|
|||||||
err = readArchive(w, route)
|
err = readArchive(w, route)
|
||||||
} else {
|
} else {
|
||||||
w.WriteHeader(http.StatusNotFound)
|
w.WriteHeader(http.StatusNotFound)
|
||||||
w.Write([]byte("not found :("))
|
w.Write([]byte(`<html>
|
||||||
|
<head><title>404 Not Found</title></head>
|
||||||
|
<body>
|
||||||
|
<center><h1>404 Not Found</h1></center>
|
||||||
|
<hr><center>fes</center>
|
||||||
|
</body>
|
||||||
|
</html>`))
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ var gitCommit string = "devel"
|
|||||||
|
|
||||||
const PROGRAM_NAME string = "fes"
|
const PROGRAM_NAME string = "fes"
|
||||||
const PROGRAM_NAME_LONG string = "fes/fSD"
|
const PROGRAM_NAME_LONG string = "fes/fSD"
|
||||||
const VERSION string = "1.0.1"
|
const VERSION string = "1.1.0"
|
||||||
|
|
||||||
func Version() {
|
func Version() {
|
||||||
fmt.Printf("%s version %s\n", PROGRAM_NAME_LONG, VERSION)
|
fmt.Printf("%s version %s\n", PROGRAM_NAME_LONG, VERSION)
|
||||||
|
|||||||
Reference in New Issue
Block a user