Rewrite configuration setup
See original GitHub issueI’ve been playing around a bit with configuration: https://github.com/tipsy/javalin/pull/507
The general idea is to move away from app.enabledXyz
methods, and to reduce the amount of methods on the Javalin
class:
val app = Javalin.create().config { c ->
c.contextPath = "/"
c.caseSensitiveUrls = false
c.devLogging = true
c.requestLogger { ctx, ms ->
println("${ctx.method()} ${ctx.path()}, took $ms}")
}
c.server { Server() }
c.addStaticFiles("/public")
c.addSinglePageHandler("/", "/public/subpage/index.html")
}.start()
Any thoughts?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Creating Rewrite Rules for the URL Rewrite Module
Summary. In this walkthrough, you have learned how to configure URL rewrite rules by using IIS manager or by manually editing Web.config files....
Read more >Set Up and Use the IIS URL Rewrite Module (Step by Step)
Learn how to securely redirect URLs and fix broken links to your website with the IIS URL Rewrite module on your server in...
Read more >How to Configure mod_rewrite {With 5 Practical Examples}
mod_rewrite helps rewrite URLs. Learn how to set up and get started with URL rewriting through useful examples in this guide.
Read more >Apache Tomcat 9 (9.0.70) - The rewrite Valve
The rewrite valve can be configured as a valve added in a Host. See virtual-server documentation for information on how to configure it....
Read more >How To Set Up Mod_Rewrite - DigitalOcean
Section 3—How to Rewrite URLS · RewriteRule: This is the section in which you can write in the name of the the mod_rewrite...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Alternative:
It’s not really a feature of Javalin, it’s reading a file and mapping it to a Kotlin/Java object. I see that a lot of people are confused about this, so I can write a tutorial after Javalin 3 is done.