Skip to content

Commit

Permalink
#1 start adding reactjs
Browse files Browse the repository at this point in the history
  • Loading branch information
obriensystems authored and Michael committed Jun 26, 2017
1 parent 8d4d061 commit d7d01ad
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 6 deletions.
15 changes: 11 additions & 4 deletions onap-demo.web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,22 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- tag::actuator[] -->

<!-- avoid restarts -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- end::actuator[] -->
<!-- tag::tests[] -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- end::tests[] -->
</dependencies>

<properties>
Expand All @@ -42,6 +45,10 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- may not be required -->
<configuration>
<addResources>true</addResources>
</configuration>
</plugin>
<!-- plugin>
<artifactId>maven-failsafe-plugin</artifactId>
Expand Down
7 changes: 5 additions & 2 deletions onap-demo.web/src/main/java/org/onap/demo/HomeController.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
package org.onap.demo;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestMapping;

@RestController
//@RestController
@Controller
public class HomeController {

@RequestMapping("/")
public String index() {
return "Greetings from Spring Boot!";
//return "Greetings from Spring Boot!";
return "index.html";
}

}
44 changes: 44 additions & 0 deletions onap-demo.web/src/main/resources/static/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!DOCTYPE html>
<html>
<head>
<title>ONAP vFirewall Demo</title>
<!-- react -->
<script src="https://unpkg.com/react@15/dist/react.js"></script>
<script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script>

</head>

<body>
<div id="root">Test</div>
<script>

ReactDOM.render(
<h1>Hello, world!</h1>,
document.getElementById('root')
);

</script>

<!-- div class='container'>
<div id='root'></div>
<form action="/logout" method="post">
<input class="btn btn-danger center-block" type="submit" value="Logout" />
</form>
</div-->

<!-- script src="https://unpkg.com/[email protected]/babel.min.js"></script-->
<!-- script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.2/react.min.js"></script>
<script src="https://fb.me/react-dom-15.0.1.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.24/browser.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script-->
<!-- script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.3/toastr.min.js"></script-->

<!-- red buttons -->
<!-- link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.3/toastr.min.css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/-->

<!-- script type="text/babel" src="/public/app.js"></script-->

</body>

</html>

0 comments on commit d7d01ad

Please sign in to comment.