0

i was asked to build a simple application that gets some data from a database and return it for that i used express as backend tool and angular as a frontend . Now i am asked to deploy it on a live server that uses windows IIS , For that i used IISnode ,i've installed it and it works fine , however when i access my app it gives me this error : "(node:7016) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues" .

the probleme is i did not use that function anywhere in my application .

this my app.js code : `

var express = require('express');

var indexRouter = require('./routes/index');

var app = express();

app.use(function(req, res, next) {
  res.header("Access-Control-Allow-Origin", "http://localhost:4200");
  res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");

  next();
});

app.use(express.json());
app.use(express.urlencoded({ extended: false }));

app.use('/', indexRouter);



// error handler
app.use(function(err, req, res, next) {
  // set locals, only providing error in development
  res.locals.message = err.message;
  res.locals.error = req.app.get('env') === 'development' ? err : {};

  // render the error page
  res.status(err.status || 500);
  res.render('error');
});

module.exports = app;`

this is web.config file :

<configuration>
  <system.webServer>

    <!-- indicates that the hello.js file is a node.js application 
    to be handled by the iisnode module -->

    <handlers>
      <add name="iisnode" path="app.js" verb="*" modules="iisnode" />
    </handlers>

    <!-- use URL rewriting to redirect the entire branch of the URL namespace
    to hello.js node.js application; for example, the following URLs will 
    all be handled by hello.js:

        http://localhost/node/express/myapp/foo
        http://localhost/node/express/myapp/bar

    -->

    <rewrite>
      <rules>
        <rule name="myapp">
          <match url="/*" />
          <action type="Rewrite" url="app.js" />
        </rule>
      </rules>
    </rewrite>

  </system.webServer>
</configuration>

Can anyone tells me what i am doing wrong ??

bg1
  • 54
  • 8
  • could you explain you are using yarn or npm? and which node and npm version you are using? is this full error message? you can also refer this [link](https://stackoverflow.com/questions/47332793/use-node-js-express-on-iis-with-iisnode) – Jalpa Panchal Jul 18 '19 at 09:08
  • i am using npm node version 10.16.0 and npm version 6.9.0 – bg1 Jul 18 '19 at 10:27
  • could you share your detail error message snapshot? – Jalpa Panchal Jul 19 '19 at 08:12
  • This is what i am getting : (node:7016) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues – bg1 Jul 19 '19 at 09:07

0 Answers0