Skip to content

coffeefedora/partone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

partone

setting up directory and serving static files using go-chi

directory layout and concepts

I come from a Asp.net MVC background. as such there is some conventions:

  • controllers: this is where URl routes are handled. I use Root to refer to paths at /.
    Otherwise, sub paths are handled by named controllers.
    /admin is handled by admin.go
    /admin/DeleteSomething would be a route defined and handled in the admin.go file.
  • views: views are laid out to match the controllers. a view such as views/admin/ListUsers.tmpl would be found used in the admin controller, preferrably in AdminListUsersHandler()
  • public: list of public static files, such as css, images, javascript.

In later parts I will be using this same layout, and extending it as the application becomes more complex.

About

setting up directory and serving static files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published