Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semantics concerning ViewController and bundle.js served by Hapi #14

Open
nogtini opened this issue Mar 2, 2017 · 0 comments
Open

Semantics concerning ViewController and bundle.js served by Hapi #14

nogtini opened this issue Mar 2, 2017 · 0 comments

Comments

@nogtini
Copy link

nogtini commented Mar 2, 2017

Trying to tackle a 500 error wherein

'use strict'

const Controller = require('trails-controller')

module.exports = class ViewController extends Controller {

  render (request, reply) {
    reply.view('components/environments/TrailsMix')
  }
}

is trying to serve the app via the root component as a "view". Note that components/... is a pre-build folder, so all views attempting to be served are being looked for these components in the dist folder which only contains the bundle to be served.

As such, this bundle.js is no view, but rather simply the payload needed for the browser to take control, spinning up the SPA.

Ideally, we'd want to solve this simply by not extending or rendering from the Controller, but instead simply serving the bundle via the controller on the index request.

@nogtini nogtini changed the title Semantics concerning ViewController served by Hapi Semantics concerning ViewController and bundle.js served by Hapi Mar 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant