Skip to content

feat: serve "/pages" module #32

@pemrouz

Description

@pemrouz

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions