Guitarra

command module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2023 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

🎸 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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址