在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):felixzapata/gulp-stubby-server开源软件地址(OpenSource Url):https://github.com/felixzapata/gulp-stubby-server开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):Gulp Stubby Server
Inspired by Grunt Stubby. Getting Startednpm install gulp-stubby-server --save-dev The "stubby" taskUsage ExamplesDefault Optionsgulp.task('stubby', function(cb) {
var options = {
files: [
'mocks/*.{json,yaml,js}'
]
};
stubby(options, cb);
}); Custom Optionsgulp.task('stubby', function() {
var options = {
callback: function (server, options) {
server.get(1, function (err, endpoint) {
if (!err)
console.log(endpoint);
});
},
stubs: 8000,
tls: 8443,
admin: 8010,
files: [
'mocks/foobar.json',
'mocks/another-foobar-file.yaml',
'mocks/foobar.yml',
'mocks/another-foobar-file.js'
]
};
stubby(options, cb);
}); Optionsoptions.filesType: Config files to run the server. It can accept a list of files or a glob pattern. options.stubsType: Port number to run the stubs portal options.tlsType: Port number to run the stubs portal over https options.adminType: Port number to run the admin portal options.dataType: JavaScript Object/Array containing endpoint data. This option will be automatically filled from the JSON/YAML config files, however you can additionally add a customized data options.locationType: Address/hostname at which to run stubby options.relativeFilesPathType: When you use the 'file' property for the request/response config Objects, enabling this options the data file path is relative to the the config file where it has been declared. options.keyType: Path to keyfile contents (in PEM format) options.certType: Certificate file path contents (in PEM format) options.pfxType: Pfx file path contents (mutually exclusive with key/cert options) options.watchType: Filename to monitor and load as stubby's data when changes occur options.quietType: Pass in false to have console output (if available) options.callbackType: Callback function when the server starts successfully. The passed arguments are:
options.persistentType: Run the task in a persistent keep-alive server mode. Other tasks not will run until the Stubby server stops APIstopAllows you to programmatically shutdown the stubby server.
ContributingIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Gulp. TestingClone the repository $ git clone https://github.com/felixzapata/gulp-stubby-server.git && cd gulp-stubby-server Install dependencies $ npm install Run tests $ npm test Release History
LicenseUnder MIT license |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论