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

Can't choose base server route #637

Open
Omig12 opened this issue Aug 20, 2022 · 6 comments
Open

Can't choose base server route #637

Omig12 opened this issue Aug 20, 2022 · 6 comments
Labels
feat New feature or request resolved-in-fresh-2

Comments

@Omig12
Copy link

Omig12 commented Aug 20, 2022

I'm trying to build a site with the main landing page being an existing static index.html. I can´t find how to point to this route as the base route for the server in the Documentation. My goal is to avoid rewriting the existing static content and just build other interactive content alongside it. Any suggestions or examples are welcomed. Thanks! :)

@alexbezhan
Copy link

I have similar task. No need to use rendering for a static index.html

@Omig12
Copy link
Author

Omig12 commented Aug 22, 2022

When I start the server, even if there is an index.html in the static folder, localhost:8080/ returns nothing unless I search for localhost:8080/index.html. I might be misunderstanding the documentation, but I think it suggests that the existence of a static file takes priority over any equivalently named route, and I assumed that would be the case for the / route.

@lucacasonato lucacasonato added the feat New feature or request label Aug 23, 2022
@lucacasonato
Copy link
Member

Interesting! I'll think about how to best approach this.

@rottenpen
Copy link

rottenpen commented Aug 24, 2022

Interesting! I'll think about how to best approach this.

@lucacasonato I write a simple pr for this issue. user can add the static html to ./staticRoute dir

#655

can you be my mentor for this feature?

@Omig12
Copy link
Author

Omig12 commented Nov 10, 2022

In case anyone is wondering how to solve this, you can potentially set up a redirect like this:

// routes/index.tsx

export default function Landing() {
    return (
        <main>
            <meta http-equiv="refresh" content="0; URL=./index.html" />
        </main>
    );
}

@marvinhagemeister
Copy link
Collaborator

From what I understand the expectation here is that fresh automatically searches for index.html files if present and serves these instead of going through the routing mechanisms. Kinda similar to how nginx or apache2 serve index.html files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request resolved-in-fresh-2
Projects
None yet
Development

No branches or pull requests

5 participants