From 233f75c561d119cf4103343bd5df4faef81ac5a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Oliva?= Date: Wed, 24 May 2023 15:33:21 -0600 Subject: First simple Get Request. Returns a string with a "GET" request and on the page "/greet". --- src/main/java/com/encora/Main.java | 19 +++++++++++++++++++ src/main/resources/application.yml | 2 ++ 2 files changed, 21 insertions(+) create mode 100644 src/main/java/com/encora/Main.java create mode 100644 src/main/resources/application.yml (limited to 'src') diff --git a/src/main/java/com/encora/Main.java b/src/main/java/com/encora/Main.java new file mode 100644 index 0000000..7591eed --- /dev/null +++ b/src/main/java/com/encora/Main.java @@ -0,0 +1,19 @@ +package com.encora; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@SpringBootApplication +@RestController +public class Main { + public static void main(String[] args) { + SpringApplication.run(Main.class, args); + } + + @GetMapping("/greet") + public String greet() { + return "Hello world!"; + } +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..afef73d --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,2 @@ +server: + port: 9090 \ No newline at end of file -- cgit v1.2.3