Initial Commit

This commit is contained in:
Mysaa Java
2026-08-23 08:02:46 +02:00
commit 902ba26df3
17 changed files with 2831 additions and 0 deletions
@@ -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;
}