]> www.hackdaworld.org Git - outofuni/tavern.git/commitdiff
init master
authorhackbard <hackbard@hackdaworld.org>
Mon, 22 Aug 2016 22:10:31 +0000 (00:10 +0200)
committerhackbard <hackbard@hackdaworld.org>
Mon, 22 Aug 2016 22:10:31 +0000 (00:10 +0200)
package.json [new file with mode: 0644]
tavern.js [new file with mode: 0644]
views/tavern.ejs [new file with mode: 0644]

diff --git a/package.json b/package.json
new file mode 100644 (file)
index 0000000..14aa198
--- /dev/null
@@ -0,0 +1,15 @@
+{
+  "name": "tavern",
+  "version": "1.0.0",
+  "description": "Utility to organize your tavern.",
+  "main": "tavern.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "repository": {
+    "type": "git",
+    "url": "hackbard@hackdaworld.org:/chroot/git/outofuni/tavern.git"
+  },
+  "author": "hackbard@hackdaworld.org",
+  "license": "Apache-2.0"
+}
diff --git a/tavern.js b/tavern.js
new file mode 100644 (file)
index 0000000..03b5684
--- /dev/null
+++ b/tavern.js
@@ -0,0 +1,47 @@
+/*
+ * ./tavern.js - main (of the) tavern server code
+ *               the NE of the NEAN stack
+ *                   ax
+ *                   np
+ *                   or
+ *                    e
+ *                    s
+ *                    s
+ * 
+ * author: hackbard@hackdaworld.org
+ *
+ */
+
+var express=require('express');
+var nano=require('nano');
+
+// the server app
+var tavern=express();
+
+// serve client code
+tavern.set('views',path.join(__dirname,'views'));
+tavern.set('view engine','ejs');
+tavern.use(express.static(path.join(__dirname,'public')));
+
+// routes
+tavern.get('/',function(req,res) {
+       res.send("Application 'tavern' is up and running ...");
+});
+
+tavern.get('/tables',function(req,res) {
+       res.send("Tables ...");
+});
+
+tavern.get('/orders',function(req,res) {
+       res.send("Orders ...");
+});
+
+tavern.get('/products',function(req,res) {
+       res.send("Products ...");
+});
+
+// start server listening on 1337
+tavern.listen(1337,function() {
+       console.log("Application 'tavern' listening on port 1337 ...");
+});
+
diff --git a/views/tavern.ejs b/views/tavern.ejs
new file mode 100644 (file)
index 0000000..74943d2
--- /dev/null
@@ -0,0 +1 @@
+Main tavern UI window!