Skip to content

Commit

Permalink
hello world
Browse files Browse the repository at this point in the history
  • Loading branch information
fawad1997 committed Apr 14, 2020
1 parent 74c983e commit 63116f8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# SpringWebAPI
Create a package for controllers in src>main>java>[your pakage name]/controller

Add a controller to display hello world message. **@RestController** makes it restfull controller and **@RequestMapping(value = "/hello")** defines URL mapping
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.restfulspring.apiexample.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
@RequestMapping(value = "/hello")
public String sayHello(){
return "Hello World!";
}
}

0 comments on commit 63116f8

Please sign in to comment.