olsonpm/sqlite-to-rest

Enable CORS

Closed this issue · 4 comments

Hi,

To support a cross-origin use case I modified skeleton.js like so:

https://gist.github.com/cyclecycle/19c98ca8b757fce3908c952ccb2c1e5c

I think it could be good to have this is integrated, by providing --cors-origin as a command line argument.

I've had a brief look at the code and found that I could change template.tpl and the generateSkeleton function in order to add this feature. I have not been able to find how to modify the command line utility to accept the --cors-origin argument however.

If you could tell me how that would be great.

P.s., Thanks a lot for this module

glad you found this helpful. I'm actually surprised how many people found this repo which has just hung out on github since I wrote it.

I'll take a look this weekend about adding the command line argument and get back to ya. I'm definitely open to adding it.

Finally got around to this - I appreciate your patience.

At first I was thinking how single options for various use-cases like this wouldn't scale well, and that an option to point to your own skeleton file would be preferable. But then I realized this skeleton file was never meant to be the final product, just a bare-minimum starting point.

So I think I'd prefer to leave the skeleton file as-is. If people need additional functionality like CORS then it should be expected they edit the skeleton.js file, preferably renaming it.

let me know whether that makes sense. Also I'm open to adding a message after generating the skeleton to make this more apparent.

Hi there, yep, that makes total sense. Thanks a lot for getting back.

Just closing this for clean-up. Always feel free to re-open