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

Add project:serve-web #66

Merged
merged 2 commits into from Feb 3, 2021
Merged

Conversation

bhageena
Copy link
Contributor

@bhageena bhageena commented Feb 2, 2021

If the web folder has package.json, it proxies to the current/given namespace APIs and runs npm start otherwise serves static content using 'npx http-server'
links #45
Usage:
nim web serve defaults to the current project's web folder
nim web serve /projects/nim/demo-projects/election
nim web serve /exp/ncovstats

Copy link
Contributor

@rabbah rabbah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool.

this.wrap(content, packLocation, logger, code, signal)
})
} else {
const httpServer = spawn(`npx http-server --proxy ${proxy}`, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a programmatic interface to use instead? Is this better than an internal api? I don’t know which is better so simply asking.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's possible to do it using internal APIs or we might even add http-server as a dependency and use its APIs, let's get the user feedback first. I am keeping that avenue open for the next iteration.

@bhageena bhageena marked this pull request as ready for review February 3, 2021 12:17
@bhageena bhageena changed the title Add web:serve Add project:serve-web Feb 3, 2021
Copy link
Contributor

@joshuaauerbachwatson joshuaauerbachwatson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Approving. I am holding off on merge until I test it (will probably test and merge all three outstanding PRs together).

@joshuaauerbachwatson joshuaauerbachwatson merged commit dd89f80 into nimbella:master Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants