Skip to content

Commit e019d70

Browse files
committed
change website to spring boot application to make less error
1 parent 7040fd9 commit e019d70

File tree

28 files changed

+109
-72
lines changed

28 files changed

+109
-72
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,6 @@ __pycache__/
8383

8484
# gradle
8585
.gradle
86+
87+
# maven
88+
.versionsBackup

porter_springboot/api/common/endpoint/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>org.apache.servicecomb.samples.porter</groupId>
2424
<artifactId>common-api</artifactId>
25-
<version>2.0.0</version>
25+
<version>2.1.0</version>
2626
</parent>
2727

2828
<artifactId>common-api-endpoint</artifactId>

porter_springboot/api/common/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<parent>
2424
<groupId>org.apache.servicecomb.samples.porter</groupId>
2525
<artifactId>porter-api</artifactId>
26-
<version>2.0.0</version>
26+
<version>2.1.0</version>
2727
</parent>
2828

2929
<artifactId>common-api</artifactId>

porter_springboot/api/common/service/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>org.apache.servicecomb.samples.porter</groupId>
2424
<artifactId>common-api</artifactId>
25-
<version>2.0.0</version>
25+
<version>2.1.0</version>
2626
</parent>
2727

2828
<artifactId>common-api-service</artifactId>

porter_springboot/api/file-service/endpoint/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>org.apache.servicecomb.samples.porter</groupId>
2424
<artifactId>file-service-api</artifactId>
25-
<version>2.0.0</version>
25+
<version>2.1.0</version>
2626
</parent>
2727

2828
<artifactId>file-service-api-endpoint</artifactId>

porter_springboot/api/file-service/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<parent>
2424
<groupId>org.apache.servicecomb.samples.porter</groupId>
2525
<artifactId>porter-api</artifactId>
26-
<version>2.0.0</version>
26+
<version>2.1.0</version>
2727
</parent>
2828

2929
<artifactId>file-service-api</artifactId>

porter_springboot/api/file-service/service/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>org.apache.servicecomb.samples.porter</groupId>
2424
<artifactId>file-service-api</artifactId>
25-
<version>2.0.0</version>
25+
<version>2.1.0</version>
2626
</parent>
2727

2828
<artifactId>file-service-api-service</artifactId>

porter_springboot/api/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<parent>
2424
<groupId>org.apache.servicecomb.samples.porter</groupId>
2525
<artifactId>porter-application</artifactId>
26-
<version>2.0.0</version>
26+
<version>2.1.0</version>
2727
</parent>
2828

2929
<artifactId>porter-api</artifactId>

porter_springboot/api/user-service/endpoint/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>org.apache.servicecomb.samples.porter</groupId>
2424
<artifactId>user-service-api</artifactId>
25-
<version>2.0.0</version>
25+
<version>2.1.0</version>
2626
</parent>
2727

2828
<artifactId>user-service-api-endpoint</artifactId>

porter_springboot/api/user-service/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<parent>
2424
<groupId>org.apache.servicecomb.samples.porter</groupId>
2525
<artifactId>porter-api</artifactId>
26-
<version>2.0.0</version>
26+
<version>2.1.0</version>
2727
</parent>
2828

2929
<artifactId>user-service-api</artifactId>

porter_springboot/api/user-service/service/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>org.apache.servicecomb.samples.porter</groupId>
2424
<artifactId>user-service-api</artifactId>
25-
<version>2.0.0</version>
25+
<version>2.1.0</version>
2626
</parent>
2727

2828
<artifactId>user-service-api-service</artifactId>

porter_springboot/file-service/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>org.apache.servicecomb.samples.porter</groupId>
2424
<artifactId>porter-application</artifactId>
25-
<version>2.0.0</version>
25+
<version>2.1.0</version>
2626
</parent>
2727

2828
<artifactId>porter-file-service</artifactId>

porter_springboot/file-service/src/main/resources/application.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
## ---------------------------------------------------------------------------
1818
# spring boot configurations
1919
server:
20-
port: 9091 # should be same with servicecomb.rest.address to use web container
20+
port: 9092 # should be same with servicecomb.rest.address to use web container
2121

2222
# override common configurations in common module
2323
servicecomb-config-order: 10
@@ -36,7 +36,7 @@ servicecomb:
3636
watch: false
3737

3838
rest:
39-
address: 0.0.0.0:9091 # should be same with server.port to use web container
39+
address: 0.0.0.0:9092 # should be same with server.port to use web container
4040

4141
uploads:
4242
directory: tmp_for_upload_file

porter_springboot/gateway-service/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<groupId>org.apache.servicecomb.samples.porter</groupId>
2424
<artifactId>porter-application</artifactId>
25-
<version>2.0.0</version>
25+
<version>2.1.0</version>
2626
</parent>
2727

2828
<artifactId>porter-gateway-service</artifactId>

porter_springboot/gateway-service/src/main/java/org/apache/servicecomb/samples/porter/gateway/StaticWebpageDispatcher.java

-52
This file was deleted.

porter_springboot/gateway-service/src/main/resources/META-INF/services/org.apache.servicecomb.transport.rest.vertx.VertxHttpDispatcher

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,4 @@
1515
# limitations under the License.
1616
#
1717

18-
org.apache.servicecomb.samples.porter.gateway.ApiDispatcher
19-
org.apache.servicecomb.samples.porter.gateway.StaticWebpageDispatcher
18+
org.apache.servicecomb.samples.porter.gateway.ApiDispatcher

porter_springboot/gateway-service/src/main/resources/application.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,16 @@ servicecomb:
5858
edge:
5959
default:
6060
enabled: false
61-
rest:
62-
pattern: '[/v1/log/|/inspector](.*)'
61+
http:
62+
enabled: true
63+
pattern: /ui/(.*)
64+
mappings:
65+
website:
66+
prefixSegmentCount: 0
67+
path: "/ui/.*"
68+
microserviceName: website
69+
versionRule: 0.0.0+
70+
6371

6472
# This is web root for windows server, change this path according to where you put your source code
6573
gateway:

porter_springboot/pom.xml

+6-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
<groupId>org.apache.servicecomb.samples.porter</groupId>
2424
<artifactId>porter-application</artifactId>
25-
<version>2.0.0</version>
25+
<version>2.1.0</version>
2626
<packaging>pom</packaging>
2727

2828
<properties>
@@ -62,13 +62,18 @@
6262
<groupId>org.apache.servicecomb</groupId>
6363
<artifactId>solution-basic</artifactId>
6464
</dependency>
65+
<dependency>
66+
<groupId>org.apache.servicecomb</groupId>
67+
<artifactId>registry-service-center</artifactId>
68+
</dependency>
6569
</dependencies>
6670

6771
<modules>
6872
<module>api</module>
6973
<module>file-service</module>
7074
<module>user-service</module>
7175
<module>gateway-service</module>
76+
<module>website</module>
7277
</modules>
7378

7479
<build>

porter_springboot/user-service/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<parent>
2424
<groupId>org.apache.servicecomb.samples.porter</groupId>
2525
<artifactId>porter-application</artifactId>
26-
<version>2.0.0</version>
26+
<version>2.1.0</version>
2727
</parent>
2828

2929
<artifactId>porter-user-service</artifactId>

porter_springboot/website/pom.xml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<parent>
5+
<groupId>org.apache.servicecomb.samples.porter</groupId>
6+
<artifactId>porter-application</artifactId>
7+
<version>2.1.0</version>
8+
</parent>
9+
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>porter-website</artifactId>
13+
<packaging>jar</packaging>
14+
15+
<dependencies>
16+
<dependency>
17+
<groupId>org.apache.servicecomb</groupId>
18+
<artifactId>java-chassis-spring-boot-starter-servlet</artifactId>
19+
</dependency>
20+
</dependencies>
21+
22+
<build>
23+
<plugins>
24+
<plugin>
25+
<groupId>org.apache.maven.plugins</groupId>
26+
<artifactId>maven-dependency-plugin</artifactId>
27+
</plugin>
28+
<plugin>
29+
<groupId>org.springframework.boot</groupId>
30+
<artifactId>spring-boot-maven-plugin</artifactId>
31+
</plugin>
32+
</plugins>
33+
</build>
34+
35+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package org.apache.servicecomb.samples.porter.user;
2+
3+
import org.apache.servicecomb.springboot2.starter.EnableServiceComb;
4+
import org.springframework.boot.SpringApplication;
5+
import org.springframework.boot.autoconfigure.SpringBootApplication;
6+
7+
@SpringBootApplication
8+
@EnableServiceComb
9+
public class WebsiteApplication {
10+
public static void main(String[] args) throws Exception {
11+
SpringApplication.run(WebsiteApplication.class, args);
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Spring Boot configurations
2+
server:
3+
port: 9091
4+
# servlet.path: /
5+
6+
APPLICATION_ID: porter-application
7+
service_description:
8+
version: 0.0.1
9+
name: website
10+
11+
servicecomb:
12+
service:
13+
registry:
14+
address: http://localhost:30100
15+
instance:
16+
watch: false
17+
18+
rest:
19+
address: 0.0.0.0:9091 # should be same with server.port to use web container
20+
## static web site will token root
21+
servlet:
22+
urlPattern: /api/*
23+
24+
metrics:
25+
publisher.defaultLog:
26+
enabled: false

0 commit comments

Comments
 (0)