Commit 5cc8261c authored by Daniel Gerhardt's avatar Daniel Gerhardt

Start server with Grunt run task

A web server for static resources and a proxy to the backend API are
now started with the run task.

ARSnova Mobile no longer relies on the backend to provide the frontend
application files. In consequence, the development environment is more
flexible. The local repositories can be located independently and it is
possible to deploy the backend as WAR file on an application server
instead of using the Maven jetty:run goal. This should ease the setup
process for pure frontend developers.

Additionally, the newly provided development environment is much closer
to the recommended production setup. The frontend is located at /mobile
while the API is accessible at /api.
parent b539d06f
......@@ -19,6 +19,45 @@ module.exports = function (grunt) {
build: buildPath
connect: {
server: {
options: {
base: buildPath + "/<%= senchaEnv %>/ARSnova",
hostname: "localhost",
port: 8081,
useAvailablePort: true,
open: true,
middleware: function (connect, options) {
var proxy = require("grunt-connect-proxy/lib/utils").proxyRequest;
return [
["/", function (req, res, next) {
if ("/" === req.url) {
res.writeHead(301, {Location: "/mobile"});
} else {
/* Let the proxy middleware handle this request */
/* Serve static files */
["/mobile", connect.static(options.base[0])],
/* Proxy for backend API */
proxies: [
context: ["/", "/api", "/arsnova-config"],
host: "localhost",
port: 8080,
xforward: true
jscs: {
all: {
src: lintJs
......@@ -102,11 +141,18 @@ module.exports = function (grunt) {
/* we want Grunt for this task to continue even if QA checks fail */
grunt.option("force", true);["newer:jscs", "newer:jshint"]);[
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment