Consign makes autoload of the module but has no response in the browser

0
nodemon] restarting due to changes...
[nodemon] starting 'babel-node . --presets env'
consign v0.1.6 Initialized in app
+ .\routes\index.js
Server rodando com o express

configured conf, nodemon warns that it loaded the index.js but in the site it informs: Can not GET /

server.js (settings) =

            import express from 'express'

            // Importar o consign (autoload)
            import consign from 'consign'

            // Importar o body parser para forms
            import * as bodyParser from 'body-parser'

            // Importar o expressValidator
            import expressValidator from 'express-validator'

            // iniciar o objeto express
            const app = express()

            // Setar a view engine e a pasta das views
            app.set('view engine','ejs')
            app.set('views','./app/views')

            // Setar a pasta de arquivos estáticos
            app.use(express.static('./app/public'))

            // Configurar o middleware body-parser 
            app.use(bodyParser.urlencoded({extended: true}))

            // Configurar o middleware express-validator
            app.use(expressValidator())

            consign({cwd: 'app'})
                .include('routes')
                .then('models')
                .then('controllers')
                .into(app)

            export default app

entrypoint = app.js

            import app from './config/server'

            //import * as indexRoute from './app/routes/index'
            //indexRoute.default(app)

            app.listen(3000, () => {
                console.log("Server rodando com o express")
            })

app / routes / index.js =

            export default (app) => {
                app.get('/', function(req, res){
                    res.render('index');
                });
            }

Does anyone have any idea what it is? if you need to upload to github

    
asked by anonymous 28.12.2018 / 22:41

1 answer

0

Should not you put the relative path in the consignment? something like this:

    consign().include('./app/routes').then('./app/controllers').then('./app/models').into(app);

Did you try this? If not, try.

    
30.12.2018 / 05:26