Muthu Kumar
7 years ago
5 changed files with 31 additions and 14 deletions
@ -1,3 +1,4 @@ |
|||
node_modules |
|||
php |
|||
wp |
|||
plugins/*/ |
@ -1,13 +1,11 @@ |
|||
'use strict' |
|||
|
|||
const { normalize } = require('path') |
|||
|
|||
module.exports = |
|||
{ |
|||
port: 8080, |
|||
php: { |
|||
bin: normalize(__dirname + '/php/php-cgi.exe') |
|||
}, |
|||
wp: { |
|||
path: normalize(__dirname + '/wp'), |
|||
root: normalize(__dirname + '/wp/index.php') |
|||
} |
|||
phpBin: normalize(__dirname + '/php/php-cgi.exe'), |
|||
wpPath: normalize(__dirname + '/wp'), |
|||
plugins: [] |
|||
} |
@ -0,0 +1,10 @@ |
|||
'use strict' |
|||
|
|||
function plugins() { |
|||
const { plugins } = require('../config') |
|||
plugins.forEach(element => { |
|||
require('../plugins/' + element + '/main.js') |
|||
}) |
|||
} |
|||
|
|||
module.exports = plugins |
@ -1,11 +1,16 @@ |
|||
var express = require('express') |
|||
var php = require("./php") |
|||
'use strict' |
|||
|
|||
const express = require('express') |
|||
const php = require("./php") |
|||
const config = require('./config') |
|||
const plugins = require('./plugins/main') |
|||
|
|||
var app = express() |
|||
const app = express() |
|||
|
|||
app |
|||
.use("/", php.cgi(config.wp.path, config.php.bin)) |
|||
.use("/", php.cgi(config.wpPath, config.phpBin)) |
|||
.listen(config.port) |
|||
|
|||
console.log(`Server listening at ${config.port}!`) |
|||
console.log(`⚡ Server listening at ${config.port}!`) |
|||
|
|||
plugins() // Run any plugins you need to while server runs
|
|||
|
Loading…
Reference in new issue