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 support for http-server #50

Merged
merged 1 commit into from
Oct 11, 2018
Merged

add support for http-server #50

merged 1 commit into from
Oct 11, 2018

Conversation

DavidWells
Copy link
Contributor

Adding support for http-server package https://www.npmjs.com/package/http-server

{
  "name": "site-xyz",
  "scripts": {
    "start:site": "http-server src --proxy http://localhost:9000/",
    "start:functions": "netlify-lambda serve functions",
    "start": "npm-run-all --parallel start:**",
    "build": "netlify-lambda build functions"
  },
  "devDependencies": {
    "http-server": "^0.11.1",
    "netlify-lambda": "^0.4.0",
    "npm-run-all": "^4.1.3"
  }
}

This PR cleans leading /.netlify/functions path from incoming proxy requests so the correct function function path is loaded.

Without it the package throws this error because of how it looks for function names

{ Error: Cannot find module '/Users/davidwells/Netlify/scratch/progressive-enhancement-form-functions/functions-build/.netlify'

@swyxio swyxio merged commit d739bb3 into master Oct 11, 2018
@erezrokah erezrokah deleted the cleanPaths branch January 14, 2021 17:09
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.

2 participants