Initial Commit
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package com.bernard.nodecames;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
@Controller
|
||||
public class HttpController {
|
||||
|
||||
@GetMapping("/")
|
||||
public String index() {
|
||||
return "index.html";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.bernard.nodecames;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class NodecamesApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(NodecamesApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.bernard.nodecames;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.HandlerMapping;
|
||||
import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping;
|
||||
import org.springframework.web.socket.WebSocketHandler;
|
||||
|
||||
import com.bernard.nodecames.frontend.GameWebSocketHandler;
|
||||
|
||||
@Configuration
|
||||
public class ThymeleafConfig {
|
||||
|
||||
@Bean
|
||||
public HandlerMapping webSocketHandler() {
|
||||
Map<String, WebSocketHandler> map = new HashMap<>();
|
||||
map.put("/path", new GameWebSocketHandler());
|
||||
return new SimpleUrlHandlerMapping(map, -1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.bernard.nodecames.frontend;
|
||||
|
||||
import org.springframework.web.socket.CloseStatus;
|
||||
import org.springframework.web.socket.WebSocketHandler;
|
||||
import org.springframework.web.socket.WebSocketMessage;
|
||||
import org.springframework.web.socket.WebSocketSession;
|
||||
|
||||
public class GameWebSocketHandler implements WebSocketHandler {
|
||||
|
||||
@Override
|
||||
public void handleMessage(WebSocketSession session, WebSocketMessage<?> message) throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleTransportError(WebSocketSession session, Throwable exception) throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus) throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterConnectionEstablished(WebSocketSession session) throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsPartialMessages() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.bernard.nodecames.model;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Entity
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class Game {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:postgresql://127.0.0.1:5432/nodecames
|
||||
username: nodecames
|
||||
password: nodecames-dev
|
||||
driver-class-name: org.postgresql.Driver
|
||||
hikari:
|
||||
schema: nodecames
|
||||
flyway:
|
||||
enabled: true
|
||||
locations: classpath:db/migration/structure, classpath:db/migration/data
|
||||
validate-on-migrate: true
|
||||
default-schema: nodecames
|
||||
create-schemas: true
|
||||
session:
|
||||
jdbc:
|
||||
initialize-schema: always
|
||||
security:
|
||||
user:
|
||||
name: mysaa
|
||||
|
||||
jpa:
|
||||
properties:
|
||||
javax:
|
||||
persistence:
|
||||
schema-generation:
|
||||
create-source: metadata
|
||||
scripts:
|
||||
action: update
|
||||
create-target: db-migration.sql
|
||||
database:
|
||||
action: none
|
||||
hibernate:
|
||||
ddl-auto: none
|
||||
generate-ddl: true
|
||||
|
||||
logging:
|
||||
level:
|
||||
root: INFO
|
||||
@@ -0,0 +1,17 @@
|
||||
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');
|
||||
*{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
font-family: 'Poppins', sans-serif;
|
||||
}
|
||||
main{
|
||||
display: flex;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #3d7091;
|
||||
font-size: 24px;
|
||||
flex-direction: column;
|
||||
margin-top: 115px;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<meta charset="UTF-8">
|
||||
<title>NodeCames</title>
|
||||
<link rel="stylesheet" th:href="@{/css/style.css}"/>
|
||||
<!-- Fontawesome CDN Link -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr" dir="ltr">
|
||||
<head>
|
||||
<div th:replace="~{html-head}"/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main>
|
||||
Vous voulez jouer à Node Cames ? Ben c'est pas encore prêt :/
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user