Permalink
Browse files

Update the web-api profile for Grails 3.1 to use the new views-json p…

…lugin
  • Loading branch information...
graemerocher committed Sep 8, 2015
1 parent d4f050c commit 18e7cff0e395a795053e797cf97c54677b830faf
@@ -8,6 +8,7 @@ buildscript {
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "org.grails.plugins:views-gradle:1.0.0-SNAPSHOT"
}
}
@@ -23,6 +24,7 @@ apply plugin: "war"
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: "org.grails.grails-web"
apply plugin: "org.grails.plugins.views-json"
ext {
grailsVersion = project.grailsVersion
@@ -55,6 +57,7 @@ dependencies {
compile "org.grails.plugins:hibernate"
compile "org.grails.plugins:cache"
compile "org.grails.plugins:views-json:1.0.0-SNAPSHOT"
compile "org.hibernate:hibernate-ehcache"
runtime "com.h2database:h2"
@@ -0,0 +1,15 @@
package @grails.codegen.defaultPackage@
import grails.core.GrailsApplication
import grails.util.Environment
import grails.plugins.*
class ApplicationController implements PluginManagerAware {
GrailsApplication grailsApplication
GrailsPluginManager pluginManager
def index() {
[grailsApplication: grailsApplication, pluginManager: pluginManager]
}
}

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -7,8 +7,8 @@ class UrlMappings {
}
}
"/"(controller: 'index')
"500"(controller: 'InternalServerError')
"404"(controller: 'NotFound')
"/"(controller: 'application', 'index')
"500"(view: '/application/serverError')
"404"(view: '/application/notFound')
}
}
@@ -0,0 +1,25 @@
import grails.core.*
import grails.util.*
import grails.plugins.*
import org.grails.core.artefact.*
model {
GrailsApplication grailsApplication
GrailsPluginManager pluginManager
}
json {
message "Welcome to Grails!"
environment Environment.current.name
appversion grailsApplication.metadata.getApplicationVersion()
grailsversion GrailsUtil.grailsVersion
appprofile grailsApplication.config.getProperty('grails.profile')
groovyversion GroovySystem.getVersion()
jvmversion System.getProperty('java.version')
controllers grailsApplication.getArtefacts(ControllerArtefactHandler.TYPE), { GrailsClass c ->
name c.fullName
}
plugins pluginManager.allPlugins, { GrailsPlugin plugin ->
name plugin.fullName
}
}
@@ -0,0 +1,4 @@
json {
message "Not Found"
error 404
}
@@ -0,0 +1,4 @@
json {
error 500
message "Internal server error"
}

0 comments on commit 18e7cff

Please sign in to comment.