ReferenceError: Cannot access 'app' before initialization

Advertisements

I have this Problem when I start my Backend, I want to test the post request in Postmann but I have this error, how can I fix it?

this is my Server . j s

>Solution :

The app variable is used before you declare it. Move your const app = express(); upward. Like this:

const express = require('express');
const app = express();

Leave a ReplyCancel reply