Creating the first web page via brew

118 Views Asked by At

When a use accesses my application, I want to return a web page that I construct using brew. Right now I have an init() - this is the function that the user specifies. The function executes brew and creates a web page. It then returns the file name of the web page.

When I attempt the following ../library/xbrowser/R/init/file I get the following error reported to the browser:

cannot coerce type 'closure' to vector of type 'character'

In call:
as.character(x)

The documentation indicates that I could use the /file output as a means to create and return a web page. Am I using this feature incorrectly? Is there a better way to create and return a web page?

1

There are 1 best solutions below

0
On

OK, I think my problem is an operator error.

I should have been testing the function with POST instead of GET which is, of course, the method used when you use a browser.

I don't get this message if I POST with curl - for instance.

My apologies for wasting anyone's time.

Peter

One more observation: don't use init as a function name; it seems to use some other namespace and complains about lazy-loading a database named 'P'