Getting error ( POST 500 Internal Server Error) when running Full-Stack Web application in Azure

asked 2021-04-26T15:55:07.83+00:00
Behrooz 1 Reputation point

I have developed a full-stack application with Vue 2, Node , Express and Postgres. I could deploy the application to Azure , and the system coming up, but when I try to do register user with Register page that I have created , I get " POST … 500 (Internal Server Error) ", **as I have tried with Postman , there is no issue in saving user data with same post controller ** .

Notice that I have set BaseURL to ‘’ in Api.js ( Client ):

import axios from ‘axios’  
import store from ‘@/store/store’  
export default () => {  
   return axios.create({  
      baseURL: ‘’,  
      headers: {  
           Authorization: Bearer ${store.state.token}  

this is Register controller in /Controller folder :

//Registering user  
async register(req, res) {  
const hash = bcrypt.hashSync(req.body.password, 10);  
     try {  
         const user = await User.create(  
         Object.assign(req.body, { password: hash })  
   const userJson = user.toJSON();  
          user: userJson,  
          token: jwtSignUser(userJson),  
  } catch (err) {  
     error: There is error in registering: ${err},  

I have added the following web.config file in dist folder, but it doesn't resolve the issue , also I have added web.config in root and has same issue :

      <mimeMap fileExtension="woff" mimeType="application/font-woff" />  
      <mimeMap fileExtension="woff2" mimeType="application/font-woff" />   
                <clear />  
                <rule name="Redirect to https" stopProcessing="true">  
                    <match url=".*" />  
                        <add input="{HTTPS}" pattern="off" ignoreCase="true" />  
                    <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />  
          <remove statusCode="404" subStatusCode="-1" />                  
          <remove statusCode="500" subStatusCode="-1" />  
          <error statusCode="404" path="/survey/notfound" responseMode="ExecuteURL" />                  
          <error statusCode="500" path="/survey/error" responseMode="ExecuteURL" />  
      <modules runAllManagedModulesForAllRequests="true"/>  

Could you please let me know how I could resolve the issue .

Azure Web Apps
Azure Web Apps
A feature of Azure App Service used to create and deploy scalable, mission-critical web apps.
4,307 questions
{count} votes