Skip to content

Commit 06162aa

Browse files
authored
Allow the use for custom middleware to allow for a wider range of plugin support (#308)
* initial custom middleware feature * Updated documentation
1 parent 96afdc4 commit 06162aa

File tree

6 files changed

+230
-118
lines changed

6 files changed

+230
-118
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Where `opts` is an object with the following properties (all optional):
5454
* **touchevents** - A boolean. Set to `false` to disable the simulation of touch events in App-Host. Defaults to `true`.
5555
* **simulationpath** - the directory where temporary simulation files are hosted. Defaults to `projectRoot/simulate`.
5656
* **simhosttitle** - specifies the title of the simulation window. Defaults to `Plugin Simulation`.
57+
* **middleware** - A path that points to express middleware. This can be used to write custom plugins that require the full power of NodeJS.
5758
* **generateids** - A boolean that generates unique ids for simulated devices at startup. Defaults to `false`.
5859

5960

bin/simulate

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function unknownOptHandler(optName) {
3535
function processArgs() {
3636
try {
3737
var parserOptions = {
38-
string: ['dir', 'simhostui', 'target', 'simulationpath', 'device', 'lang', 'theme'],
38+
string: ['dir', 'simhostui', 'target', 'simulationpath', 'device', 'lang', 'theme', 'middleware'],
3939
boolean: ['livereload', 'forceprepare', 'corsproxy', 'generateids'],
4040
default: {
4141
dir: null,
@@ -48,6 +48,7 @@ function processArgs() {
4848
device: null,
4949
lang: null,
5050
theme: null,
51+
middeware: null,
5152
generateids: false
5253
},
5354
unknown: unknownOptHandler
@@ -71,6 +72,7 @@ function processArgs() {
7172
device: parsed.device,
7273
lang: parsed.lang,
7374
theme: parsed.theme,
75+
middleware: parsed.middleware,
7476
generateids: parsed.generateids
7577
};
7678
} catch (err) {
@@ -93,6 +95,7 @@ function getUsageString() {
9395
'[--target TARGET]',
9496
'[--lang LANG]',
9597
'[--theme THEME]',
98+
'[--middleware MIDDLEWARE_PATH]',
9699
'[--generateids (GENERATEIDS)]'
97100
];
98101

0 commit comments

Comments
 (0)