Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node.js Express post method is not recognised by WebStorm 6

I'm new to node.js and I decided to try out express module on my application. Everything was ok until I tried to use app.post method. I'm writting my app on WebStorm 6.0.2 and it does't recognise it: "Unresolved function or method post()" - is what I get.

var express = require('express');
var app = express();
app.post('/', function(req, res) {});

However with get method everything is ok:

app.get('/', function(req, res){
res.send('hello world');
});
like image 858
volk Avatar asked Jan 15 '14 19:01

volk


2 Answers

Open Settings | JavaScript | Libraries click "Download" select "TypeScript community stubs" select express.js and click "Download and Install".

like image 198
MostafaMashayekhi Avatar answered Oct 16 '22 01:10

MostafaMashayekhi


known issue. The problem is that express modules are defined in rather weird way - see http://youtrack.jetbrains.com/issue/WEB-6667#comment=27-470393 for details/possible workaround

like image 3
lena Avatar answered Oct 15 '22 23:10

lena