-
Notifications
You must be signed in to change notification settings - Fork 107
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
No static content serving on test domain #140
Comments
Same problem here. Coming from pow I like pows ability to serve static content. I have a link to public (jekyll _site) in my .puma-dev dir:
When trying to connect to http://hayvalley.test I am getting a
Puma-dev log:
Christian |
I'm in the same boat. Coming from POW and Just want to serve my static content… but nothing works in High Sierra… (should have expected this, but well, you got to update at some point). With the Background LaunchAgent active I get: "unexpected exit" My setup:
Wanting to avoid port problems I settled for Port 81 on a .test domain ( I added the gem and checked for it (despite it being inactive):
Results for tail:
I even installed the puma gem and created a binstub just in case - but for static content this shouldn't matter. I also created a Results for curl:
Port 80 has something more to show:
"Feature Request: Allow static files in public directory without rackup file · Issue #87" got my hopes up and I added a I get the same when deactivating the launch agent and using Maybe @evanphx can chime in and put some light on the static issue. |
I got static serving to work by adding a run Proc.new { |env| ['200', {'Content-Type' => 'text/html'}, ['a']] } The
|
@jabr This just returns "a" instead of the website content inside |
It returns that when there is not a static file in |
But there is a file in public. I literally just replaced “a” with File.read(“public/index.html”) and it worked okay for the simple maintenance page I needed to test.
…On Feb 28, 2019, 4:27 PM -0600, Justin Bradford ***@***.***>, wrote:
It returns that when there is not a static file in public for the url. Basically a "404".
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Per the comments above, I'm successfully serving a site with just a # @see https://github.com/puma/puma-dev/issues/140#issuecomment-422575346
run Proc.new { |env|
[
'200',
{ 'Content-Type' => 'text/html' },
# @see https://github.com/puma/puma-dev/issues/140#issuecomment-468466432
[File.read("public/index.html")]
]
} I think this may be due to #102? |
Closing as duplicate of #87 |
@nonrational As of the description in the README this is not really a duplicate of #87 The README explicitly says:
So this should work at least with a |
You are correct. Allowing puma-dev to serve static files without a config.ru file is the feature request represented in #87. |
@nonrational As I thought that this may also be a browser-related issue, I tested on Safari, Chrome and Firefox (on latest MacOSX), result is the same. |
Well spotted @momolog ! https://golang.org/pkg/net/http/#ServeFile
Gotta love Go. You have to handle setting We can move to |
* link in a static site with config.ru, ensure that public files are served * s/Url/URL/g, better factoring of testAppsToLink * clarify test names * add failing tests * lots of indexes * whoops, consistent naming * ensure that we don't expose more of the filesystem than we mean to * avoid /index.html redirect by using ServeContent #140 (comment)
this has now been addressed on master and will be released as part of 0.14 soon. |
I'm on v0.17 and this is still happening. Without any config.ru, I'm not able to serve files from Getting the following with the directory structure below and
In browser when requesting: http://goodbye.local.host/index.html (same thing happens for .txt file)
This does work after adding a config.ru like the one mentioned #140 (comment) |
I'm coming from pow and wanted to use puma-dev now for me. I use a Mac with OSX 10.11.
I uninstalled
pow
withcurl get.pow.cx/uninstall.sh | sh
.I installed puma-dev with:
brew install puma/puma/puma-dev
puma-dev -V
givesVersion: 0.11 (go1.9.1)
.Then i created a
~/.puma-dev
folder and following in it:I started puma-dev with this command for testing:
sudo puma-dev -d dev:test -http-port 80 -https-port 443 -debug
When opening
http://testdomain.test
i get:unexpected exit
as error.I looked at the console and saw this:
Here are my questions:
Thanks for all the help you can get me. I take all ideas :)
PS: Sorry for my bad english ;)
The text was updated successfully, but these errors were encountered: