Express function to handle GET , POST and both

The express object can be used to create endpoints.

For making a GET request the syntax will be

app.get(“/api/get’,function);

For making a POST request

app.post(‘/api/write”,function);

For making both POST/GET in a same API Endpoint

app.any(‘/api’,function);

Thanks

Balasundaram