Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
dima767 committed Jan 23, 2020
1 parent d19f5c4 commit bb61c9b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
5 changes: 0 additions & 5 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,8 @@ bootWar {
"Implementation-Version" : "${project.version}"
)
}
from(tasks.findByPath(':ui:npm_run_buildProd').outputs) {
into 'WEB-INF/classes/templates'
include 'index.html'
}
from(tasks.findByPath(':ui:npm_run_buildProd').outputs) {
into 'WEB-INF/classes/resources'
//include 'index.html'
}
archiveName = "${baseName}-${version}.war"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
package edu.internet2.tier.shibboleth.admin.ui.controller;

import com.google.common.io.ByteStreams;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.io.OutputStream;

@Controller
public class RootUiViewController {

@Value("classpath:/resources/index.html")
Resource resourceFile;

@RequestMapping("/")
public String index() {
return "index";
@ResponseBody
public void index(HttpServletRequest request, OutputStream os) throws IOException {
final String ctxPath = request.getContextPath();
try {
byte[] indexHtmlBytes = ByteStreams.toByteArray(resourceFile.getInputStream());
os.write(indexHtmlBytes, 0, indexHtmlBytes.length);
//os.write(ctxPath.getBytes(), 0, ctxPath.length());
}
finally {
os.close();
}
}
}
3 changes: 1 addition & 2 deletions ui/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
<head>
<meta charset="utf-8">
<title>Shibboleth IDP UI</title>
<!--<base th:href="#{app.baseHref}" href="/"> -->
<base href="/">
<base href="/">

<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
Expand Down

0 comments on commit bb61c9b

Please sign in to comment.