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

feat: serve "/pages" module #32

Open
pemrouz opened this issue Dec 3, 2016 · 0 comments
Open

feat: serve "/pages" module #32

pemrouz opened this issue Dec 3, 2016 · 0 comments

Comments

@pemrouz
Copy link
Collaborator

pemrouz commented Dec 3, 2016

Inspired by next's approach, it would be a useful convenience to auto-serve everything in the /pages directory. It would mean being able to drop the line on the README:

- app.get('/*', (req, res) => res.sendFile(__dirname+'/index.html'))

And even the use of express (regular http server should be fine).

There is a bit of disconnect in next between the actual pages and the react component's it exports. It abstracts a bit too highly, then offers a Head component to tweak the <head>. I think in our case it should be fine to just statically serve this directory rather than trying to interpret a component as a page. Using a custom element in HTML is super trivial:

<script src="ripple.js"></script>
<my-app></my-app>
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