From 6119f28e72fa8cea8353f8813ca4cb43ffd44af1 Mon Sep 17 00:00:00 2001 From: Bruno Bossola Date: Sat, 5 Sep 2015 16:13:26 +0100 Subject: [PATCH] Added time service --- time/package.json | 8 ++++++++ time/time.js | 12 ++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 time/package.json create mode 100644 time/time.js diff --git a/time/package.json b/time/package.json new file mode 100644 index 0000000..e32d8c6 --- /dev/null +++ b/time/package.json @@ -0,0 +1,8 @@ +{ + "name": "time-microservice", + "author": "Bruno Bossola", + "private": true, + "dependencies": { + "express": "^4.13.3" + } +} diff --git a/time/time.js b/time/time.js new file mode 100644 index 0000000..70382e3 --- /dev/null +++ b/time/time.js @@ -0,0 +1,12 @@ +var express = require("express");   +var http = require('http'); +var app = express();   + +app.get("/", function(request, response) {   + var now = new Date(); +    response.json({ time: now.toString() }); +});                                          + +app.listen(3002, function() {                        + console.log("Hello service started on port 3002"); +}); \ No newline at end of file