-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
45 lines (40 loc) · 1.11 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
const winston = require('winston');
const { ADD_APACHE_CONFIG, ADD_APACHE_COMMANDS, UPDATE_HTTPD_VHOSTS } = require('../actions');
const yargs = require('@devly/devly-cli');
const Apache = require('../scripts/apache');
const apache = new Apache();
const initialState = {};
winston.cli();
function addApacheConfig(state, config){
return {...state, ...config};
}
function addApacheCommands(state){
yargs.command('apache init','Init file, app, or machine',
{
force: {
alias: 'f',
default: false,
},
},
function handler(argv) {
winston.log('info','Initializing Proxy Server!');
apache.init(argv.force);
}
);
return state;
}
function updateHttpdVhosts(force, ports, vHost, fileName, directoryPath){
return state;
}
module.exports = function apacheReducer(state = initialState, action){
switch (action.type) {
case ADD_APACHE_CONFIG:
return addApacheConfig(state, action.config);
case ADD_APACHE_COMMANDS:
return addApacheCommands(state);
case UPDATE_HTTPD_VHOSTS:
return updateHttpdVhosts(state);
default:
return state;
}
}