summaryrefslogtreecommitdiff
path: root/routes
diff options
context:
space:
mode:
authorRafael Marçalo <rafael.marcalo@cast.pt>2022-10-21 02:00:10 +0100
committerRafael Marçalo <rafael.marcalo@cast.pt>2022-10-21 02:00:10 +0100
commitdad891f9d7f060c5d2f4c9f47c410730aa48d5df (patch)
tree8d9bca113b426bb2dd6d5b9884a3ed6e84202f79 /routes
Added initially developed files
Diffstat (limited to 'routes')
-rw-r--r--routes/home.js8
-rw-r--r--routes/info.js8
-rw-r--r--routes/search.js13
-rw-r--r--routes/settings.js8
4 files changed, 37 insertions, 0 deletions
diff --git a/routes/home.js b/routes/home.js
new file mode 100644
index 0000000..98e086b
--- /dev/null
+++ b/routes/home.js
@@ -0,0 +1,8 @@
+"use strict";
+
+function home(req, res)
+{
+ res.render('index');
+};
+
+module.exports = home; \ No newline at end of file
diff --git a/routes/info.js b/routes/info.js
new file mode 100644
index 0000000..61b2c87
--- /dev/null
+++ b/routes/info.js
@@ -0,0 +1,8 @@
+"use strict";
+
+function info(req, res)
+{
+ res.render('info');
+};
+
+module.exports = info; \ No newline at end of file
diff --git a/routes/search.js b/routes/search.js
new file mode 100644
index 0000000..4ef050c
--- /dev/null
+++ b/routes/search.js
@@ -0,0 +1,13 @@
+"use strict";
+
+const apibay = require('../server/js/apibay');
+const template = require('../server/js/template');
+
+async function search(req, res)
+{
+ let query = req.body.search;
+ let results = await apibay.hit(query);
+ res.render('result', {query: query, results: results, functions: template});
+};
+
+module.exports = search; \ No newline at end of file
diff --git a/routes/settings.js b/routes/settings.js
new file mode 100644
index 0000000..be6a899
--- /dev/null
+++ b/routes/settings.js
@@ -0,0 +1,8 @@
+"use strict";
+
+function settings(req, res)
+{
+ res.render('settings');
+};
+
+module.exports = settings; \ No newline at end of file