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');
});
Open Settings | JavaScript | Libraries click "Download" select "TypeScript community stubs" select express.js and click "Download and Install".
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With