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

Run a folder as http server #212

Closed
cosbgn opened this issue Jul 12, 2021 · 1 comment
Closed

Run a folder as http server #212

cosbgn opened this issue Jul 12, 2021 · 1 comment

Comments

@cosbgn
Copy link

cosbgn commented Jul 12, 2021

Hi,

ON my project I have an /api folder with inside a few files like:"

  • file_one.js
  • file_two.js
  • etc

Each file is a lambda functions, something like this:

exports.handler = async (event, context) => {
	return  {
	  statusCode: 200,
	  headers: { 'Content-Type': 'application/json' },
	  body: JSON.stringify({ message: "Hello from file_one" })
	}
}

I would like to start a http local server which would map:

Is this possible?

@gpotter2
Copy link
Collaborator

Hi,
This is slighly too high level for lambda-local, and currently not implemented. It would however be easy to implement something like that yourself using a NodeJS http.server object, and calling lambda-local through it.
Have a good day

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

2 participants