For loading serve inside an app
That would be really cool 馃憤
Hi everyone. I want to work on this.
Going through the code, I see that when using the CLI, we determine the args and the directory by line 43 in bin/serve.js.
A high-level solution, I think, would be to extract the rest of the file into a function that accepts flags and directory as arguments. We could then just export that function as the API.
What are your thoughts on this?
@dar5hak Great idea! Maybe we can even keep the CLI like it is and just let the programmatic API run the CLI as a command using child_process.spawn or child_process.exec + setting the flags by setting process.argv. 馃
@leo Oh yes! That would be simpler. I'll send a pull request tonight (UTC+0530).
Would you prefer an index.js at the project root, or inside lib/?
@dar5hak A file named api.js inside lib/... 馃槉