# See the License for the specific language governing permissions and
# limitations under the License.
+module example_advanced_logger is example
+
import popcorn
import realtime
redef fun all(req, res) do req.timer = new Clock
end
-class LogHandler
+class AdvancedLoggerHandler
super Handler
redef fun all(req, res) do
end
end
-class HelloHandler
+class AnotherHandler
super Handler
redef fun get(req, res) do res.send "Hello World!"
end
var app = new App
-app.use("/*", new RequestTimeHandler)
-app.use("/", new HelloHandler)
-app.use("/*", new LogHandler)
+app.use_before("/*", new RequestTimeHandler)
+app.use("/", new AnotherHandler)
+app.use_after("/*", new AdvancedLoggerHandler)
app.listen("localhost", 3000)