0
votes

I have a single page web application, grails url mapping contains

"/**"(view: "/index")

as well as few routes that start with /api/* The problem happens when I'm trying to access /dbconsole that comes with a plugin. This would still be served through the first mapping. I tried to exclude dbconsole like this

"/$ember?"(view: "/index", constraints {ember(notEqual: 'dbconsole')})

But it always throws an exception.

1
what exception? provide all relevant url-mappingsinjecteer
Why not just keep dbconsole disabled (or manually disable it via grails.dbconsole.enabled if we're talking about the development environment)?Gregor Petrin
what if i need dbconsole? @GregorMacchiatow
I was assuming you need it disabled since you talked about excluding.. I'll provide a proper answer, then.Gregor Petrin
Hmm actually the first thing you can do is add a colon after constraints: constraints: {ember(notEqual: 'dbconsole')}, the error you're getting is due to bad syntax.Gregor Petrin

1 Answers

1
votes

You can define an exclude in the URL mappings:

class UrlMappings {
    static excludes = ["/dbconsole*"]
    static mappings = {
        //your app's usual URL mappings
    }
}

Since dbconsole is not served through the usual URL resolution process you will still be able to access it.