Muthu Kumar
7 years ago
5 changed files with 31 additions and 14 deletions
@ -1,3 +1,4 @@ |
|||||
node_modules |
node_modules |
||||
php |
php |
||||
wp |
wp |
||||
|
plugins/*/ |
@ -1,13 +1,11 @@ |
|||||
|
'use strict' |
||||
|
|
||||
const { normalize } = require('path') |
const { normalize } = require('path') |
||||
|
|
||||
module.exports = |
module.exports = |
||||
{ |
{ |
||||
port: 8080, |
port: 8080, |
||||
php: { |
phpBin: normalize(__dirname + '/php/php-cgi.exe'), |
||||
bin: normalize(__dirname + '/php/php-cgi.exe') |
wpPath: normalize(__dirname + '/wp'), |
||||
}, |
plugins: [] |
||||
wp: { |
|
||||
path: normalize(__dirname + '/wp'), |
|
||||
root: normalize(__dirname + '/wp/index.php') |
|
||||
} |
|
||||
} |
} |
@ -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') |
'use strict' |
||||
var php = require("./php") |
|
||||
|
const express = require('express') |
||||
|
const php = require("./php") |
||||
const config = require('./config') |
const config = require('./config') |
||||
|
const plugins = require('./plugins/main') |
||||
|
|
||||
var app = express() |
const app = express() |
||||
|
|
||||
app |
app |
||||
.use("/", php.cgi(config.wp.path, config.php.bin)) |
.use("/", php.cgi(config.wpPath, config.phpBin)) |
||||
.listen(config.port) |
.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