OzanOcak / my-next-app

1 stars 0 forks source link

running netlify functions on server #7

Open OzanOcak opened 2 years ago

OzanOcak commented 2 years ago

npm install netlify-cli -g touch netlify.toml mkdir functions and api call in charge-card.js file netlify dev curl `http://localhost:8888/.netlify/functions/card

charge-card.js

exports.handler = async (event, context) => {
  return {
    statusCode: 200,
    body: "I have charged that card many times!",
  };
};