TypeError: customExpress is not a function at Object. (/home/fretappdev/Área de Trabalho/projeto/index.js:3:13) at Module.compile (node:internal/modules/cjs/loader:1101:14) at Object.Module.extensions..js (node:internal/modules/cjs/loader:1153:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module.load (node:internal/modules/cjs/loader:822:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/runmain:81:12) at node:internal/main/run_main_module:17:47 [nodemon] app crashed - waiting for file changes before starting...
MEU CÓDIGO>> index.js
const customExpress = require('./config/customExpress');
const app = customExpress()
app.listen(3000, () => console.log('servidor rodando na porta 3000'))
customExpress.js
const express = require('express')
const consign = require('consign')
module.exportes = () => {
const app = express()
consign()
.include('controllers')
.into(app)
return app
}
atendimentos.js
module.exports = app => {
app.get('/atendimentos', (req, res) => res.send('Você está na rota de atendimentos e está realizando um get!'));
}
OBS: Não entendo o motivo de afirmar que "customExpress is not a function",tentei todos os métodos que achei.