Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential PR for adding serve from zip feature #27

Open
MattMcFarland opened this issue Aug 31, 2022 · 0 comments
Open

Potential PR for adding serve from zip feature #27

MattMcFarland opened this issue Aug 31, 2022 · 0 comments

Comments

@MattMcFarland
Copy link

Hello Akamai Folks! I've been using a customized version of this plugin for the last few years but really my team would prefer we stay up to date with Akamai and suggested that I submit a PR, but I wanted to ask you how best to implement this.

Because my team has no need to upload anything but a zip file, I went the "easy" route and just made this change to your upload function:

            let request = {
                    action: "version=1&action=upload&index-zip=1",
                    method: "PUT",
                    path: path,
                    body: body
            }

as you can see, I simply added &index-zip=1 - but obviously this is not the best route if we want something that works with files that aren't zipped as well.

When looking at this again, I figured there are a couple of things I could do. I could make it use a flag like --zip , but I don't see you using a pattern like this with any of the other commands. If I do use this option. would it automatically appear on the options object? So if I added --zip would options.zip be true?

Another thing I thought of is just copying this and making another function called uploadZip - it would essentially do the same thing but at the &index-zip=1 - this would allow me to not worry about options.zip, and also it would make this behave like the other commands, since all the commands seem to just take single arguments without options.

MY preference would be to use the --zip feature.. but I'm not sure if it would appear on the options object, and I'm not sure if that's the pattern you want to follow.

Could someone from the akamai team let me know what would be OK? I'll submit a PR after, and thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant