* @ngdoc function * @name start * @param {HTTPServer} server Instance of the server from the http module * @description * Starts the development or production server
()
| 225 | * Starts the development or production server |
| 226 | */ |
| 227 | function start() { |
| 228 | |
| 229 | var plan = tasks.plan(arguments); |
| 230 | |
| 231 | // Hook in streaming if called with HTTP server |
| 232 | if (plan.httpServer) { |
| 233 | // depr |
| 234 | api.log.error('The API has changed you can no longer create the HTTP server yourself.'); |
| 235 | } |
| 236 | |
| 237 | load(); |
| 238 | tasks.defaults(); |
| 239 | |
| 240 | tasks.start(plan.targets,plan.callback); |
| 241 | |
| 242 | if (!exitRegistered) { |
| 243 | process.on('exit', api.unload); |
| 244 | exitRegistered = true; |
| 245 | } |
| 246 | |
| 247 | return api; |
| 248 | } |
| 249 | |
| 250 | /** |
| 251 | * @ngdoc function |