From 57aff6852a1049443c2a93d322d2894be9c9ee00 Mon Sep 17 00:00:00 2001 From: hackbard Date: Tue, 23 Aug 2016 00:10:31 +0200 Subject: [PATCH 1/1] init --- package.json | 15 +++++++++++++++ tavern.js | 47 +++++++++++++++++++++++++++++++++++++++++++++++ views/tavern.ejs | 1 + 3 files changed, 63 insertions(+) create mode 100644 package.json create mode 100644 tavern.js create mode 100644 views/tavern.ejs diff --git a/package.json b/package.json new file mode 100644 index 0000000..14aa198 --- /dev/null +++ b/package.json @@ -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 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 index 0000000..74943d2 --- /dev/null +++ b/views/tavern.ejs @@ -0,0 +1 @@ +Main tavern UI window! -- 2.39.2