From: hackbard Date: Mon, 22 Aug 2016 22:10:31 +0000 (+0200) Subject: init X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=outofuni%2Ftavern.git init --- 57aff6852a1049443c2a93d322d2894be9c9ee00 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!