I write a signup webpage with nodejs
, and in this webpage, I use ajax
to call the function signup
like this
$.ajax({
method: "POST",
url: "/signup",
data: { tel: tel, password: password}
})
And in app.js
, the signup
function like this
.post('/signup', async (ctx) => {
//do something
})
And now everyone can call the signup
function with the url http://domain/signup
without visiting the signup webpage, I think it's a mistake, I only want the local program can call this function, how can I fix this?