Friday, August 28, 2015, 7:53:45 PM, Pradeep Murugesan wrote:
> Hi Daniel,
> I have made the rest service up @ a new path /compile
> The service takes the following json as input
> { "template": "Hello ${user}", "dataModel": "user=pradeep"}
> and then compiles the template and dataModel and returns the output.
> https://github.com/pradeepmurugesan/freemarker-online/commit/10de59ac0db0bf0f79ab28214f50c851a5610e20
>
> Please review the above commit and let me know if its ok.
The response will have to be JSON as well (not TEXT_PLAIN), but I
guess that was planned later.
The usage of the "compile" term is confusing here, as you actually
parse (aka. compile) and then "process" (aka. execute) here. The last
naturally implies the first. So I guess it should be, like, "run" or
"execute".
Also, all the web service operations should go under /api/, and the UI
outside it.
> Will
> Integrate with the UI. I have a questions though
> 1. Should I modify in the same path as "/" or keeping it in a
> separate path like "/compile" is fine ?
The UI addresses should remain /, and the current web service should
be under /api/run or something, I think.
> Also I will write unit tests once we finalize the path.
> Pradeep.
--
Thanks,
Daniel Dekany