diff --git a/package.json b/package.json index 3e338df..8d3f530 100644 --- a/package.json +++ b/package.json @@ -85,6 +85,7 @@ "tslint": "5.6.0", "tslint-eslint-rules": "4.1.1", "typescript": "2.4.2", - "vrsource-tslint-rules": "5.1.1" + "vrsource-tslint-rules": "5.1.1", + "express": "4.16.3" } } diff --git a/server.js b/server.js new file mode 100644 index 0000000..a703ce7 --- /dev/null +++ b/server.js @@ -0,0 +1,19 @@ +const ngApimock = require('./tasks/index')(); +const express = require('express'); +const app = express(); +ngApimock.run({ + "src": "test/mocks", + "outputDir": ".tmp/ngApimock", + "done": function () { + } +}); +app.set('port', 3000); + +// process the api calls through ng-apimock +app.use(require('./lib/utils').ngApimockRequest); +// serve the mocking interface for local development +app.use('/mocking', express.static('.tmp/ngApimock')); + +app.listen(app.get('port'), function () { + console.info('ngapimock running on port', app.get('port')); +});