Browse Source

Working MVP

master
Muthu Kumar 7 years ago
parent
commit
4d88ef8abe
  1. 1
      .gitignore
  2. 4
      .vscode/settings.json
  3. 6
      README.md
  4. 1
      config.js
  5. 53
      package-lock.json
  6. 1
      package.json
  7. 31
      server.js

1
.gitignore

@ -1,4 +1,5 @@
node_modules
php
wp
sqlite
plugins/*/

4
.vscode/settings.json

@ -3,7 +3,5 @@
"editor.renderWhitespace": "boundary",
"editor.insertSpaces": false,
"editor.tabSize": 4,
"files.eol": "\n",
"editor.wordWrap": "wordWrapColumn",
"editor.wordWrapColumn": 80
"files.eol": "\n"
}

6
README.md

@ -8,12 +8,14 @@ Bring the power of Node.JS to your WordPress environment!
### Running the server
Steps 1-3 will have an automated option later.
1. Download php zip from https://php.net and place the extracted files under `/php`.
2. Download WordPress from https://wordpress.org and place the extracted files under `/wp`.
3. [Optional] If you're on Linux, edit the config file to point to your `php-cgi` bin file.
3. [Optional / Haven't tested] If you're on Linux, edit the config file to point to your `php-cgi` bin file.
4. Run `npm install` to install dependencies (Express).
5. Run `node .` to start the server.
### Versioning
Due to certain reasons, our versioning bumps from `v.0.1.0` to `v.1.1.0`. Due to this, the project should be considered unstable until `v.2.0.0` which will be the first public release version.
Due to certain reasons, our versioning bumps from `v.0.1.0` to `v.1.1.0`. Due to this, the project should be considered unstable until `v.2.0.0` which will be WordBoxed's first stable release version.

1
config.js

@ -7,5 +7,6 @@ module.exports =
port: 8080,
phpBin: normalize(__dirname + '/php/php-cgi.exe'),
wpPath: normalize(__dirname + '/wp'),
sqlite: '',
plugins: []
}

53
package-lock.json

@ -1,6 +1,6 @@
{
"name": "wordboxed",
"version": "0.0.1",
"name": "w",
"version": "1.1.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -13,6 +13,14 @@
"negotiator": "0.6.1"
}
},
"ansi-styles": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
"integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
"requires": {
"color-convert": "1.9.1"
}
},
"array-flatten": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
@ -40,6 +48,29 @@
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz",
"integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg="
},
"chalk": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz",
"integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==",
"requires": {
"ansi-styles": "3.2.0",
"escape-string-regexp": "1.0.5",
"supports-color": "4.5.0"
}
},
"color-convert": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz",
"integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==",
"requires": {
"color-name": "1.1.3"
}
},
"color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
},
"content-disposition": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz",
@ -93,6 +124,11 @@
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
},
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
},
"etag": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
@ -178,6 +214,11 @@
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
},
"has-flag": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
"integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE="
},
"http-errors": {
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz",
@ -355,6 +396,14 @@
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz",
"integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew=="
},
"supports-color": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz",
"integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=",
"requires": {
"has-flag": "2.0.0"
}
},
"type-is": {
"version": "1.6.15",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz",

1
package.json

@ -26,6 +26,7 @@
},
"homepage": "https://github.com/codefeathers/wordboxed#readme",
"dependencies": {
"chalk": "^2.3.0",
"express": "^4.16.2"
}
}

31
server.js

@ -1,16 +1,43 @@
'use strict'
const express = require('express')
const php = require("./php")
const php = require('./php')
const chalk = require('chalk')
const config = require('./config')
const plugins = require('./plugins/main')
const fancyIntro =
chalk.yellow(`
----------------------------------
| .---. |
| /. ./| |
| .--'. ' ; |
| /__./ \\ : | |
| .--'. ' \\' . |
| /___/ \\ | ' ' |
| ; \\ \\; : |
| \\ ; | |
| . \\ .\\ ; |
| \\ \\ ' \\ | |
| : ' |--" |
| \\ \\ ; |
| '---" |
----------------------------------
WordBoxed
The modern WordPress environment
----------------------------------`) + chalk.green(`
Server running at port ${config.port}
----------------------------------
`)
const app = express()
app
.use("/", php.cgi(config.wpPath, config.phpBin))
.listen(config.port)
console.log(`⚡ Server listening at ${config.port}!`)
console.log(fancyIntro)
plugins() // Run any plugins you need to while server runs

Loading…
Cancel
Save