Skip to main content

Posts

Showing posts with the label grails

Groovy Grails POST/GET Requests

Just a snippet of how to do GET/POST request in Groovy Grails. try{       HttpBuilder http = new HTTPBuilder('your URL here')       def postBody = [name: 'bob', title: 'construction worker']       http.post(body: postBody,                         requestContentType: ContentType.JSON) { resp, json ->                     //This is to assume everything is successful within this                         //closure                     println "response status " + resp.statusLine                     println "json response " + json                                      } }catc...

Grails Deployment on Openshift

Just a simple guide on how to get started on deploying a Grails app up to Openshift. The prerequisites to get started, we need two things being Git and the Openshift RHC tool. Guide on how to install them in different OS platforms are available here . This is only a simple static website developed using Grails. This guide is based off on https://www.openshift.com/blogs/day-6-rapid-web-development-on-the-jvm-with-grails Step 1: Don't bother creating the free app on the Openshift application console. Instead we're gonna use the Openshift RHC command line tool and create the free app. Do this in your user directory: rhc create-app appname tomcat-7 This will create a gear that is assumed to be Jboss EWS 2.0, but it's not. Anyways, assuming that you're not doing any data storing functionality on the Grails app, tomcat-7 is what you need. So let everything being taken cared of for you, and a repo will be cloned based on the appname that yo...