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

Support loading an HTML file with a custom name #36

Merged
merged 5 commits into from
Jan 22, 2024

Conversation

mhkeller
Copy link
Contributor

As discussed in #33, this makes it possible to load a file that isn't called index.html, which could be useful if you're serving more than one file. I put this together for my own use but figured it may be useful for others. Feel free to make any changes!

@mhkeller mhkeller mentioned this pull request Jan 21, 2024
readme.md Outdated Show resolved Hide resolved
@sindresorhus
Copy link
Owner

You need to update the types too.

@sindresorhus sindresorhus merged commit c307a57 into sindresorhus:main Jan 22, 2024
2 checks passed
@sindresorhus
Copy link
Owner

Thanks :)

1 similar comment
@sindresorhus
Copy link
Owner

Thanks :)

@mhkeller
Copy link
Contributor Author

Thanks for going through it so quickly!

@iamspruce
Copy link

iamspruce commented Jan 23, 2024

An example of this would be nice. serving html files inside sub folders doesn’t appear to work well.

I have this example

const appServe = serve({dirctory: “out”})

now when creating windows I can use the following urls

win.loadURL(“app://-“) // this works
secondWin.loadURL(“app://-/settings.html”) // this works as well
thirdWin.loadURL(“app://-/subfolder/name.html”) // this doesn’t work I don’t know why

The thirdWin doesn’t work, I don’t know why? I’m I doing something wrong or something?

@mhkeller
Copy link
Contributor Author

mhkeller commented Apr 3, 2024

You may need to add a separate scheme for the other windows to work.

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

Successfully merging this pull request may close these issues.

3 participants