You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-45Lines changed: 4 additions & 45 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,9 @@
1
1
[![MIT License][license-badge]][LICENSE]
2
2
3
-
# :copyright:java-play-angular-seed
3
+
# java-play-angular-seed
4
4
5
5
> java-play-angular-seed project illustrates how Play Framework can be used to develop backend/services along with Angular to develop the front-end/ui.
6
6
7
-
> This is a totally integrated Java Play 2.6.x + Angular 5 with Angular CLI seed project with full-fledged build process.
There are several demonstration files available in this template.
120
-
121
-
- HomeController.java:
122
-
123
-
Shows how to handle simple HTTP requests.
124
114
125
115
## Routes
126
116
@@ -129,44 +119,13 @@ There are several demonstration files available in this template.
129
119
│ ├── routes
130
120
```
131
121
132
-
*All the route definitions should be included in this file based on higher priority first. In this example project following route is added to retrieve the summary.
122
+
*The following route configuration allows to map front end index.html to index route. This should be placed as the first route in this file.
133
123
134
124
```
135
-
GET /summary controllers.HomeController.appSummary()
125
+
GET / controllers.Assets.at(path="/public/ui", file="index.html")
136
126
```
137
127
138
-
* The below service is there in the front-end to manage the http requests which defined in the backend service.
139
-
140
-
```
141
-
├── /ui/
142
-
│ ├── /src/
143
-
│ │ ├── /app/
144
-
│ │ │ ├── app.service.ts
145
-
```
146
-
147
-
```javascript
148
-
@Injectable()
149
-
exportclassAppService {
150
-
private serviceUrl ='/summary';
151
-
152
-
constructor(privatehttp:HttpClient) {
153
-
}
154
-
155
-
/**
156
-
* Makes a http get request to retrieve the welcome message from the backend service.
157
-
*/
158
-
publicgetWelcomeMessage() {
159
-
returnthis.http.get(this.serviceUrl)
160
-
.map(response=> response)
161
-
}
162
-
}
163
-
```
164
-
165
-
## Components
166
-
167
-
- Module.java:
168
-
169
-
Bind all the components needed by your application.
128
+
**Note: _On production build all the front end Angular build artifacts will be copied to the `public/ui` folder._**
0 commit comments