Skip to content

Commit

Permalink
added getRest in handler and app
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Blumin committed Mar 9, 2021
1 parent b68b73a commit b34d9ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/edu/cooper/ece366/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public static void main( String[] args )
get("/ping", (req, res) -> "OK");
get("/user/:userId", (req, res) -> handler.getUser(req), gson::toJson);
get("/lobby/:lobbyId", (req, res) -> handler.getLobby(req), gson::toJson);
get("/restaurant/:restId", (req, res) -> handler.getRest(req), gson::toJson);

//get("/me", (req, res) -> handler.me(req, res), gson::toJson);

Expand Down
5 changes: 5 additions & 0 deletions src/main/java/edu/cooper/ece366/handler/Handler.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ public Lobby getLobby(Request request) {
return lobbyStore.get(lobbyID);
}

public Restaurant getRest(Request request) {
String restID = request.params(":restID");
return restaurantStore.get(restID);
}

/*
public List<Restaurant> getRestList(Request req){
Expand Down

0 comments on commit b34d9ee

Please sign in to comment.