🎸 Guitarra
Static files router written in Go with Fiber 🔷
Installation executable
Just download latest realease
How to Use
Run downloaded program like below, it will host your files from foldername on address - 127.0.0.1:3000.
$ ./router.exe -f foldername
Change port
To change default port you have to add port flag like below. In this example port is set to 3030.
$ ./router.exe -f foldername -port=3030
Reload and edit files
- If you added new file, you should reload files. Just press
r key in Cli.
- If you changed file content you dont need to reload files.
Routing system
Routing system is based on folder strucutre
-
+ Prefix in filename mean file is public and will be hosted, files without + prefix in filename are private. Hosted files had removed + prefix.
📖 mysite/+message.txt -> mysite/message.txt
-
+page.html - Main file in route, will be hosted on route without filename.
📖 mysite/about/+page.html -> mysite/about
-
Dynamic route is created with [ - prefix and ] - suffix .
📖 mysite/news/[title] -> mysite/news/whatever
Run from source
Clone the project
git clone github.com/Pla9er9/Guitarra
Go to the project directory
cd Guitarra
Start the server with example
go run . -f .\example
Run tests
To run tests, run the following command
go test
MIT License