0

I'm starting a project which requires me to create a service which will return a JS file. The JS file I return will be injected into a containing HTML page which I know nothing about.

My service will get parameters in the query string which will affect the result returned, in addition I'd like to unify files for easier work. In other words the returned response is dynamic rather than a statically served js file.

I was thinking of using an MVC engine (doesn't matter which one), since it simplifies just that - the ability to dynamically edit responses. But trying out different kind of view engines for node and for asp.net mvc, they made all kind of problems since I guess I'm not using them the way they were meant for.

Do you know of a solution that can help my needs? maybe a view engine that supports such option, or maybe an entirely different approach. I was thinking maybe I should even write my own view engine, but I'd much rather finding an easier way.

omerko
  • 19
  • 1
  • Your JS files will be physical files or it will stored in database? – Mox Shah Apr 18 '15 at 10:41
  • Physical files, but some of the content inside will be dynamic, for example json embedded into it according to data received from DB. – omerko Apr 18 '15 at 12:25
  • Thank you, this answers it and will do the trick Do you know of a view engine for node.js express who does that? – omerko Apr 18 '15 at 12:26

0 Answers0