large changes
This commit is contained in:
5
examples/extentions/Fes.toml
Normal file
5
examples/extentions/Fes.toml
Normal file
@@ -0,0 +1,5 @@
|
||||
[app]
|
||||
|
||||
name = "extentions"
|
||||
version = "0.0.1"
|
||||
authors = ["vx-clutch"]
|
||||
33
examples/extentions/README.md
Normal file
33
examples/extentions/README.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# extentions
|
||||
|
||||
```
|
||||
fes new extentions
|
||||
```
|
||||
|
||||
> **Know what you are doing?** Delete this file. Have fun!
|
||||
|
||||
## Project Structure
|
||||
|
||||
Inside your Fes project, you'll see the following directories and files:
|
||||
|
||||
```
|
||||
.
|
||||
├── Fes.toml
|
||||
├── README.md
|
||||
└── www
|
||||
└── index.lua
|
||||
```
|
||||
|
||||
Fes looks for `.lua` files in the `www/` directory. Each file is exposed as a route based on its file name.
|
||||
|
||||
## Commands
|
||||
|
||||
All commands are run from the root of the project, from a terminal:
|
||||
|
||||
| Command | Action |
|
||||
| :------------------------ | :----------------------------------------------- |
|
||||
| `fes run .` | Runs the project at `.` |
|
||||
|
||||
## What to learn more?
|
||||
|
||||
Check out [Fes's docs](https://docs.vxserver.dev/static/fes.html).
|
||||
12
examples/extentions/www/index.lua
Normal file
12
examples/extentions/www/index.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
local fes = require("fes")
|
||||
local site = fes.fes()
|
||||
|
||||
site.copyright = fes.util.copyright("https://fsd.vxserver.dev/", "fSD")
|
||||
|
||||
site:extend("myext", {
|
||||
shout = function(self, str) return self:g(str:upper()) end
|
||||
})
|
||||
|
||||
site.myext:shout("hello world")
|
||||
|
||||
return site
|
||||
Reference in New Issue
Block a user