aboutsummaryrefslogtreecommitdiffstats
path: root/src/controllers
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2019-03-04 17:33:20 +0100
committerHarald Eilertsen <haraldei@anduin.net>2019-03-04 17:33:20 +0100
commitcd6eba8b2b70404e93d9d4b0832faa7c9f00d217 (patch)
tree3ff74c7c8dcfb43ba590b53695209062bc4d62b2 /src/controllers
parent14cf4b8fdd69b31c8030b6530bbe07fd1df5b25a (diff)
downloadramaskrik-social-cd6eba8b2b70404e93d9d4b0832faa7c9f00d217.tar.gz
ramaskrik-social-cd6eba8b2b70404e93d9d4b0832faa7c9f00d217.tar.bz2
ramaskrik-social-cd6eba8b2b70404e93d9d4b0832faa7c9f00d217.zip
Refactoring, move db connection and room controller to separate modules.
Diffstat (limited to 'src/controllers')
-rw-r--r--src/controllers/room.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/controllers/room.rs b/src/controllers/room.rs
new file mode 100644
index 0000000..27f6a41
--- /dev/null
+++ b/src/controllers/room.rs
@@ -0,0 +1,29 @@
+/*
+ Social program for Ramaskrik.
+ Copyright (C) 2019 Harald Eilertsen <haraldei@anduin.net>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
+*/
+
+use crate::db;
+use rocket::get;
+use rocket_contrib::{
+ json,
+ json::JsonValue,
+};
+
+#[get("/")]
+pub fn get_rooms(_db: db::Connection) -> JsonValue {
+ json!([])
+}