Comments (4)
Perhaps allow:
- The user to customise the path to the error pages (but provide a default otherwise)
- The ability to call a function to handle error pages (404, 500, etc)
- The same when using
Recovery()
middleware.
Obviously it's best to keep things slim, but good looking error pages are useful when dealing with non-technical users.
from martini.
All good points. I will keep this in mind when designing this handler
from martini.
For the record, gorilla/mux implements it this way: https://github.com/gorilla/mux/blob/master/mux.go#L40
type Router struct {
// Configurable Handler to be used when no route matches.
NotFoundHandler http.Handler
...
}
It defaults to http.NotFoundHandler() if
r.NotFoundHandler` is nil. It is (IMO!) a quick way to let you render (with templates) 404 pages.
from martini.
Moving this to martini-contrib
. #44 solves the 404 issue somewhat on a Martini core level
from martini.
Related Issues (20)
- Does martini really support html5 Mode serving of static files? HOT 1
- Why HEAD method called on Get Routing?
- Link broken HOT 1
- Handling Gorilla Websockets
- Website hacked? HOT 1
- Wrong link? http://martini.codegangsta.io shows online gambling advertisement only HOT 1
- Use render.Render in ReturnHandler
- unit
- Unit Test
- Add support for promhttp HOT 2
- Hook to log errors if status code > 399 HOT 1
- typecheck arguments on boot-up
- How to include auth middleware that handles roles for logged-in users HOT 1
- cannot set headers HOT 1
- how to break-out of middleware chain using Martini HOT 2
- Problems with # in route matching HOT 1
- Contribution, Arabic translation
- How to become a maintainer?
- is this project dead? HOT 2
- Football
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from martini.