From 96e9e6b9872df281b8315459664f9e0aa20e58e6 Mon Sep 17 00:00:00 2001 From: treywood-qz Date: Mon, 10 Feb 2020 14:25:36 -0700 Subject: [PATCH 1/3] add Allocator class stub --- node-express/allocator.js | 17 +++++++++++++++++ node-express/index.js | 2 ++ 2 files changed, 19 insertions(+) create mode 100644 node-express/allocator.js diff --git a/node-express/allocator.js b/node-express/allocator.js new file mode 100644 index 0000000..b22bd40 --- /dev/null +++ b/node-express/allocator.js @@ -0,0 +1,17 @@ +class Allocator { + + constructor() { + + } + + allocate(serverType) { + + } + + deallocate(serverName) { + + } + +} + +module.exports = Allocator; \ No newline at end of file diff --git a/node-express/index.js b/node-express/index.js index df0b9fe..2ccffa2 100644 --- a/node-express/index.js +++ b/node-express/index.js @@ -2,6 +2,8 @@ const express = require('express'); const app = express(); const port = 3000; +const Allocator = require('./allocator'); + app.get('/', (req, res) => res.send('Hello World!')); app.listen(port, () => console.log(`Example app listening on port ${port}!`)); \ No newline at end of file From 9cce96c9a1e53d4c3e31534abb7f2850565601db Mon Sep 17 00:00:00 2001 From: treywood-qz Date: Mon, 10 Feb 2020 14:46:44 -0700 Subject: [PATCH 2/3] comment class methods --- node-express/allocator.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/node-express/allocator.js b/node-express/allocator.js index b22bd40..75f5ae6 100644 --- a/node-express/allocator.js +++ b/node-express/allocator.js @@ -4,10 +4,13 @@ class Allocator { } + // given a server type ('API', 'DB', etc) return the name of the newly allocated + // server (e.g. 'API1', 'API2', 'DB5') allocate(serverType) { } + // given a server name, remove the server from the pool deallocate(serverName) { } From f9551af1da3bf3868d38e8a8b32d2a5d978c0ff4 Mon Sep 17 00:00:00 2001 From: treywood-qz Date: Mon, 10 Feb 2020 14:48:00 -0700 Subject: [PATCH 3/3] better allocate comment --- node-express/allocator.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node-express/allocator.js b/node-express/allocator.js index 75f5ae6..b7efed2 100644 --- a/node-express/allocator.js +++ b/node-express/allocator.js @@ -4,8 +4,8 @@ class Allocator { } - // given a server type ('API', 'DB', etc) return the name of the newly allocated - // server (e.g. 'API1', 'API2', 'DB5') + // given a server type ('API', 'DB', etc) allocate a new server and + // return the name of the server (e.g. 'API1', 'API2', 'DB5') allocate(serverType) { }