static-web-apps-cli icon indicating copy to clipboard operation
static-web-apps-cli copied to clipboard

swa cannot add a function to my app

Open khowling opened this issue 3 years ago • 3 comments
trafficstars

Describe the solution you'd like I'd like to create a static web app, including a api from the swa command line.

I created a react app, used swa to deploy successfully, then I wanted to add a API, and the docs appears to direct me to use vscode extension for this? is that correct? I'd like to have a full workflow in the command line. Is this a feature you are looking to add, or am I not understanding the scope of the swa cli?

khowling avatar Aug 10 '22 17:08 khowling

Hey @khowling, The documentation covers the steps to include an api via the command line here. Could you please try it out and confirm if this is what you're looking for?

Reshmi-Sriram avatar Aug 12 '22 08:08 Reshmi-Sriram

Thanks for sharing the link @Reshmi-Sriram. It looks like your link is for starting an existing API, not creating a new API.

For example, a new user will end up at the docs page to create a new swa using the CLI here. Then, at the bottom, the doc suggests Next Steps to Add a API. That links you to a page that requires VS Code here. This doesn't flow great. I would like instructions to Add a API but continuing to use the CLI. Is it possible?

khowling avatar Aug 15 '22 11:08 khowling

@khowling,

I understand your concern now, apologies for the confusion earlier! Looks like you might be a little confused on the services SWA CLI as well as Az CLI here. Az CLI is a management-level CLI used for multiple resources across Azure services. Whereas SWA CLI is a service-specific CLI for Static Web Apps.

As a part of the current support offered in SWA CLI, we do not have support for scaffolding a new project or API via SWA CLI. But yes, I understand and hear your concerns. We shall rework on improving the documentation efforts for the same, but meanwhile do check out this document for the extended list of optional parameters which are supported via AZ CLI az staticwebapp create

cc// @craigshoemaker

Reshmi-Sriram avatar Aug 16 '22 09:08 Reshmi-Sriram

@khowling, Please let us know if you have more queries here.

sulabh-msft avatar Aug 29 '22 16:08 sulabh-msft

Thank you!

khowling avatar Aug 30 '22 15:08 khowling