Browse Source

initial commit

feat/r2dbc
Antoine 8 months ago
commit
70b32f380c
Signed by: antoine <antoinroux@hotmail.fr> GPG Key ID: 098FB66FC0475E70
5 changed files with 141 additions and 0 deletions
  1. +22
    -0
      .editorconfig
  2. +3
    -0
      .gitignore
  3. +79
    -0
      pom.xml
  4. +30
    -0
      src/main/java/tk/antoine_roux/wiki/MainLauncher.java
  5. +7
    -0
      src/main/resources/application.properties

+ 22
- 0
.editorconfig View File

@@ -0,0 +1,22 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Set default charset
[*.java]
charset = utf-8

# Tab indentation (no size specified)
[Makefile]
indent_style = tab

# Indentation override for all JS under lib directory
[**.{properties, json, yml, yaml}]
indent_style = space
indent_size = 2

+ 3
- 0
.gitignore View File

@@ -0,0 +1,3 @@
.idea/
*.iml
target/

+ 79
- 0
pom.xml View File

@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>fr.antoine-roux</groupId>
<artifactId>wikiProject</artifactId>
<version>${revision}</version>
<name>wikiProject</name>
<description>project use wikipedia streaming api https://stream.wikimedia.org/?doc#/Streams/get_v2_stream_test</description>

<properties>
<revision>1.0-SNAPSHOT</revision>
<java.version>14</java.version>
<spring-boot.version>2.3.2.RELEASE</spring-boot.version>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
</properties>

<dependencyManagement>
<dependencies>
<!-- spring-boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>${spring-boot.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- spring-boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<release>${java.version}</release>
<compilerArgs>--enable-preview</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>

</project>

+ 30
- 0
src/main/java/tk/antoine_roux/wiki/MainLauncher.java View File

@@ -0,0 +1,30 @@
package tk.antoine_roux.wiki;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.function.RouterFunction;
import org.springframework.web.servlet.function.RouterFunctions;
import org.springframework.web.servlet.function.ServerResponse;

/**
* Main class
* program input
*/
@SpringBootApplication
public class MainLauncher {

/*
* entry point for our application
*/
public static void main(String[] args) {
SpringApplication.run(MainLauncher.class, args);
}

@Bean
public RouterFunction<ServerResponse> routes() {
return RouterFunctions.route()
.GET("/toto", serverRequest -> ServerResponse.ok().body("hello world !"))
.build();
}
}

+ 7
- 0
src/main/resources/application.properties View File

@@ -0,0 +1,7 @@
spring.main.banner-mode=off
spring.main.lazy-initialization=true
spring.output.ansi.enabled=ALWAYS

server.port=8081

wikiproject.basePath=/wikiproject

Loading…
Cancel
Save