michaelneu / webxcel

🤔 A REST backend built with plain VBA Microsoft Excel macros. Yes. Macros.
https://dev.to/michaelneu/to-vba-and-beyond---building-a-restful-backend-using-plain-microsoft-excel-macros-76n
MIT License
438 stars 70 forks source link

serverside scripting #10

Closed michaelneu closed 5 years ago

michaelneu commented 5 years ago

add support for e.g. PHP using FastCGI

FFSSolutions commented 5 years ago

Hi Michael very cool what you've done here. As to server side scripting what are your thoughts? I am interested in integrating support for Access DB. Is this something you have tried out is there any barriers that you know of in doing this?

michaelneu commented 5 years ago

As for serverside scripting, I was thinking of integrating PHP using its TCP interface some time, because running PHP from an Excel webserver feels so wrong. I've added that to the first comment for clarification. If you want to take a look at that, feel free to do so, but I wanted to do this too 😄

I haven't tried adding support for MS Access yet, but it might be worth taking a look at. If done correctly, one could generate a REST backend from Access files instead of Excel only. I guess using SQL, it'd also be easier to build the JSON structure than using the WorksheetRelationshipMapper. I've created a new issue for this: #17

Regarding general serverside scripting: webxcel should be able to handle basic VBA scripting using the IWebController interface already. By overriding the MatchesUrl and ProcessRequest methods, one should be able to script basic things (pun intended) similar to this:

Implements IWebController

Private Function IWebController_MatchesUrl(requestUrl As String) As Boolean
    IWebController_MatchesUrl = True
End Function

Private Function IWebController_ProcessRequest(request As HttpRequest) As HttpResponse
    Dim response As HttpResponse
    Set response = New HttpResponse

    ' do something, e.g. connect to Access and store something in response.Body

    Set IWebController_ProcessRequest = response
End Function
FFSSolutions commented 5 years ago

Thats pretty much what I was thinking, to do. I have created a new class controller for Access and am just starting to knock that together now, also with the idea of a RESTful based premise. I love you want to do PHP because it feels wrong lol. As for me after I get this Access portion mocked up and into a beta version, I'll be looking to integrate NODE. My work circumstances are such that I do not have a proper dev server setup and need to prototype my apps in a LAN so this is what I am working with. Thanks again for putting out webxcel. you'll be hearing from me