- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add example for nginx module #2027
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
Conversation
|
||
/** | ||
* @author richardnorth | ||
*/ | ||
public class SimpleNginxTest { | ||
|
||
private static File contentFolder = new File(System.getProperty("user.home") + "/.tmp-test-container"); | ||
private static String tmpDirectory = System.getProperty("user.home") + "/.tmp-test-container"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to shift some things a bit to be able to include the test in the docs.
contentFolder.mkdir(); | ||
contentFolder.setReadable(true, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find a reason why these were being set. I'm happy to put them back but for the purposes of a test/demo I don't think they are required.
|
||
URLConnection urlConnection = nginx.getBaseUrl("http", 80).openConnection(); | ||
private static String responseFromNginx(URL baseUrl) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be done inline but I moved to a separate method to make the example more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution, @worldtiki - this looks good to me!
No description provided.