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

Neither of the buttons work #39

Open
wildlySpeculating opened this issue Apr 14, 2020 · 3 comments
Open

Neither of the buttons work #39

wildlySpeculating opened this issue Apr 14, 2020 · 3 comments

Comments

@wildlySpeculating
Copy link

Clicking either button doesn't send a response. I think the issue is that on the front end it can't find the lambda functions at '/.netlify/functions/' but I can't figure out why

@swyxio
Copy link
Contributor

swyxio commented Apr 19, 2020

soryr i dont maintain this anymore - try checking in with netlify community/support

@donavon
Copy link
Contributor

donavon commented May 8, 2020

This repo is pretty much a mess. Try adding the following to src/proxySetup.js so that CRA will proxy requests to /.netlify/functions/ to http://localhost:9000/.netlify/functions/ (the Netlify functions server).

const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function (app) {
  app.use(
    '/.netlify/functions/',
    createProxyMiddleware({
      target: 'http://localhost:9000/',
      changeOrigin: true,
    })
  );
};

@Kirbyasdf
Copy link

Kirbyasdf commented Jun 29, 2020

Hi for this to work now you need to add file src/proxySetup.js with the following syntax, then run-> ntl dev

const proxy = require('http-proxy-middleware');

module.exports = function(app) {
  app.use(
    proxy('/.netlify/functions/', {
      target: 'http://localhost:8888/'
    })
  );
};

here is my boilerplate.. it even has node functionality as-well

https://github.com/Kirbyasdf/netlify-react-lambda-NODE-boilerplate

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

No branches or pull requests

4 participants