0

We're a small team of developers and we want to develop a RESTful API service for our project. We would like to use Visual Studio for our Node.js Loopback framework development and we want to use git on VSTS for our version control. We found out that there are ways to automate build and deployment on VSTS to Azure Web app, but we're having problems creating a loopback project, creating a Visual Studio solution, and making all these work on Azure. We tried to get some help from this repository but this is not exactly how we plan to work How should we proceed?

So, we have tried creating a "Basic Azure Node.js Web Application" on Visual Studio and adding loopback to it but when we deploy this, we get "The page cannot be displayed because an internal server error has occurred." error on our page. Also we created an app.js file on the root of the project to make it point like so

var app = require('./server/server.js');
app.start();

and when we look at the logs, we see this error;

Application has thrown an uncaught exception and is terminated:
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:434:25)
    at Object..js (module.js:464:10)
    at Module.load (module.js:353:31)
    at Function._load (module.js:311:12)
    at Module.require (module.js:359:17)
    at require (module.js:375:17)
    at Object.<anonymous> (D:\home\site\wwwroot\server\server.js:3:16)
    at Module._compile (module.js:446:26)
    at Object..js (module.js:464:10)
    at Module.load (module.js:353:31)

What I think might be the problem is that we can't quite figure out how to make a loopback project in Visual Studio and also how to deploy it so that it runs on our server.

mks
  • 1
  • 1
  • I'd start by asking you to be more specific. What exactly failed? – Raymond Camden Jan 15 '18 at 15:47
  • Added details on what went wrong as @RaymondCamden suggested. – mks Jan 15 '18 at 15:55
  • 1
    The error is telling you what is wrong - I did a search for "azure node const strict mode" and found this, it may help. https://stackoverflow.com/questions/22603078/syntaxerror-use-of-const-in-strict-mode. I'd also maybe consider using a "pure" LoopBack app first as your test. Ie, not an app where you add LB in, but just the general hello world template. – Raymond Camden Jan 15 '18 at 17:03

0 Answers0