Take a look at the cookbook entry Create an HTTP Endpoint and see where you can go from there.
Also please explain what you are trying to do.
I fixed your code but in order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote ```
)
```
code goes here
```
See this post for more details - How to share code or flow json