I have declared a variable with the require, but it tells me that it is not defined, the declaration I made it inside an html file, I have already done the nodeIntegration: true and set the type on commonjs and everything I found on web, I state that I have already developed 4 other applications, and in all of them I have always used the require also in the html file and it has never given me problems, only this application is giving me this problem, do you know how to solve?
Via Active questions tagged javascript - Stack Overflow https://ift.tt/waOP7gN
I am trying to pull some data from a Postgres database using Node.js and node-postures but I can't figure out why my service isn't connecting. my routes/index.js file: const express = require('express'); const router = express.Router(); const ordersCountController = require('../controllers/ordersCountController'); const ordersController = require('../controllers/ordersController'); const weeklyReportsController = require('../controllers/weeklyReportsController'); router.get('/orders_count', ordersCountController); router.get('/orders', ordersController); router.get('/weekly_reports', weeklyReportsController); module.exports = router; My controllers/weeklyReportsController.js file: const weeklyReportsService = require('../services/weeklyReportsService'); const weeklyReportsController = async (req, res) => { try { const data = await weeklyReportsService; res.json({data}) console...
Comments
Post a Comment