Search code examples
node.jsexpresssyntax-errornodeclipse

app.delete raise syntax error on express with nodeclipse IDE


does anyone familiar with this error on nodeclipse IDE ?

  app.delete('/delete', function(req, res) {
  ....
  });

Syntax error on token ".", , expected


Solution

  • delete is a reserved word in JavaScript. In express, you should use app.del(...). For you example, the following code should work:

    app.del('/delete', function(req, res) {
       ...
    });