Commit d2b703ea authored by Fjen Undso's avatar Fjen Undso
Browse files

add some rest api routes and stub controllers

parent 431003bf
package controllers;
import play.*;
import play.mvc.*;
import views.html.*;
public class Application extends Controller {
public static Result index() {
return ok(index.render("Your new application is ready."));
package controllers;
import play.mvc.Controller;
public class QuestionController extends Controller {
package controllers;
import play.mvc.Controller;
public class SessionController extends Controller {
package controllers;
import play.mvc.Controller;
public class VoteController extends Controller {
@(message: String)
@main("Welcome to Play") {
@play20.welcome(message, style = "Java")
@(title: String)(content: Html)
<!DOCTYPE html>
<link rel="stylesheet" media="screen" href=""stylesheets/main.css")">
<link rel="shortcut icon" type="image/png" href=""images/favicon.png")">
<script src=""javascripts/hello.js")" type="text/javascript"></script>
......@@ -2,8 +2,23 @@
# This file defines all application routes (Higher priority routes first)
# ~~~~
# Home page
GET / controllers.Application.index()
# Session
GET /sessions controllers.SessionController.getSessions
GET /sessions/:id controllers.SessionController.getSession(id: String)
POST /sessions controllers.SessionController.createSession
PUT /sessions/:id controllers.SessionController.updateSession(id: String)
DELETE /sessions/:id/:owner controllers.SessionController.deleteSession(id: String, owner: String)
GET /sessions/:id/votes controllers.SessionController.getVotes(id: String)
GET /sessions/:id/questions controllers.SessionController.getQuestions(id: String)
# Map static resources from the /public folder to the /assets URL path
GET /assets/*file"/public", file)
# Question
GET /questions/:id controllers.QuestionController.getQuestion(id: String)
POST /questions/:id controllers.QuestionController.createQuestion(id: String)
PUT /questions/:id controllers.QuestionController.updateQuestion(id: String)
DELETE /questions/:id/:owner controllers.QuestionController.deleteQuestion(id: String, owner: String)
GET /questions/:id/answers controllers.QuestionController.getAnswers(id: String)
POST /questions/:id/answers controllers.QuestionController.createAnswer(id: String)
# Vote
POST /votes/:id controllers.VoteController.createVote(id: String)
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment