0

I have studied nodejs backend development for a while and last time when my friend discussed an nodejs project with me.

He referred to a piece of code listed below as api. Here is how the code looks like:

app.get('/home',(res,req)=>{
    res.sendFile('views/index.html', {root: __dirname });
});

So, is this piece of code an api or an endpoint or a route or just a get method in nodejs app?

LittleTeemo
  • 184
  • 2
  • 12
  • 1
    It is an API endpoint, served by a (most probably) Express route. It is not a `get` method as it is `post`, which is really interesting. – PeS May 18 '20 at 12:57
  • thank you, my apology. I just updated my question. So, its app.get()... – LittleTeemo May 18 '20 at 13:00

0 Answers0