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

Add-PodePage giving error 404 on browser #1143

Closed
peracchi opened this issue Sep 30, 2023 · 5 comments
Closed

Add-PodePage giving error 404 on browser #1143

peracchi opened this issue Sep 30, 2023 · 5 comments
Labels

Comments

@peracchi
Copy link

Describe the Bug

Example from https://badgerati.github.io/Pode/Tutorials/Basics/ do not work, gives 404 error.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Go to https://badgerati.github.io/Pode/Tutorials/Basics/
  2. Save example code to server.ps1
  3. pode start
  4. access address on browser
  5. See error 404

Expected Behavior

Processes running on server

Screenshots

image

Platform

  • OS: Alpine Linux edge x86_64
  • Browser: Firefox 118.0.1
  • Versions:
    • Pode: 2.8.0
    • PowerShell: 7.3.7

Additional Context

The code giving error 404 on browser is:

Start-PodeServer {
    # attach to port 8080 for http
    Add-PodeEndpoint -Address * -Port 8080 -Protocol Http

    # a simple page for displaying services
    Add-PodePage -Name 'processes' -ScriptBlock { Get-Process }
}

@Badgerati
Copy link
Owner

Hi @peracchi,

What happens if you navigate to http://10.4.2.126:8080/processes? Looking at the image above is appears only http://10.4.2.126 is being loaded?

@peracchi
Copy link
Author

peracchi commented Oct 2, 2023

Looking at the image above is appears only http://10.4.2.126 is being loaded?

Yes, you are right.

Using http://10.4.2.126:8080/processes page loads correctly.

Sorry, my fault, I assumed that without the "Path" parameter the route would be '/'.

Now I see that the "Name" parameter acts like the "Path" parameter, right?

@Badgerati
Copy link
Owner

Sort of yes, The -Path parameter on Add-PodePage is default to / and the -Name is appended onto the path. So if you set the path to be /pages and the name as processes then it would be accessible at /pages/processes.

@github-project-automation github-project-automation bot moved this from Backlog to Done in 🚀 Pode Roadmap Oct 5, 2023
@fatherofinvention
Copy link
Contributor

Hey @Badgerati does that mean it isn't possible to use Add-PodePage to create a page that is routed to / ?

@Badgerati
Copy link
Owner

Hey @fatherofinvention, yes that's correct. It's only meant as a way to create really simple quick named pages, for pages on / using Add-PodeRoute would be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

3 participants