Closed cmelone closed 8 years ago
You must do a post request to http://localhost:3000/contact because it is only a REST endpoint without any hard disk interaction.
You can find a working example on my homepage.
I just copied and pasted this code from the repositories README. Which part of the code is causing the issue, because isnt
$.ajax({
type : 'POST',
url : 'http://localhost:3000/contact',
data : $('#myContactForm').serialize(),
dataType : 'json',
encode : true
})
already posting it to http://localhost:3000/contact?
Yes it is posting to /contact but you cannot open /contact by navigating to it with your browser.
Place the HTML form and the script somewhere else on your website and let the JS do the POST to the /contact route.
I just downloaded the caddy binary with mailout included, here is my Caddyfile
template.txt:
And contact/index.html:
But when I navigate to
http://localhost:3000/contact
, i get{"code":405,"error":"Method Not Allowed"}