0

I am deploying a web app for the first time, I am following this here - https://learn.microsoft.com/en-us/azure/developer/javascript/tutorial-vscode-azure-app-service-node-03

In the example it uses npm start, but I have been using node app.js to start my application locally. Also my code is using 127.0.0.1, do I change this to the created URL? When I deployed it, I went to the azure URL and got - azurewebsites.net is currently unable to handle this request. HTTP ERROR 500.

Thank you for any hep!

enter image description here enter image description here

var config = {
    database: {
        host:     'db1.mysql.database.azure.com',   
        user:     'user',       
        password: 'password',       
        port:     3306,         
        db:       'db1'     
    
    },
    server: {
        host: '127.0.0.1',
        port: '3000'
    }
}



module.exports = config
1
  • My answer is only for the handling of the issue and the link to mysql, I hope it can help you. Commented Jul 7, 2020 at 8:33

1 Answer 1

1

UPDATE

You can deploy your webapp by git. I have create a new demo for you. You need change mysql info.

enter image description here

enter image description here

enter image description here

PRIVIOUS

I use vscode, follow the official documentation, no need to modify the port, just follow the steps to directly publish it. I suggest you use linux, it will reduce a lot of problems when creating node web app.

enter image description here

You can read the official documentation carefully. The demo I provided can be downloaded and run. The demo supports connection to mysql.

This screenshot indicates successful release.

enter image description here

I am not familiar with express, but it is normal when debugging. This screenshot is consistent with my local operation. Our focus is on publishing and connecting to mysql. Please see the screenshot of local operation below.

enter image description here

Sign up to request clarification or add additional context in comments.

6 Comments

Thanks for the reply Jason. Is there a way for me to use your example but with ejs instead of pug? All my current files are in ejs, converting it will be difficult for me
@williswin I have updated my answer, and create a demo for you. Good luck.
Thank you Jason. Am I simply able to add the dbconfig.js file to support multiple databases?
Hi Jason, I have a new question if you have time to look at it. stackoverflow.com/questions/62927550/…
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.