aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorJarno Elonen <elonen@iki.fi>2015-07-05 14:49:11 +0300
committerJarno Elonen <elonen@iki.fi>2015-07-05 14:49:11 +0300
commit582a893592ac2bd2360d753393421dd0680067cf (patch)
treee478ecd6160006011b8d23e39d5c9b3bc91ad783 /README.md
parent7745b7553684a783331afa725557dbe6a09df5b0 (diff)
downloadnanohttpd-582a893592ac2bd2360d753393421dd0680067cf.tar.gz
Removed spurious indent.
Diffstat (limited to 'README.md')
-rw-r--r--README.md70
1 files changed, 35 insertions, 35 deletions
diff --git a/README.md b/README.md
index 0039c30..6f7f439 100644
--- a/README.md
+++ b/README.md
@@ -25,41 +25,41 @@ Edit `pom.xml`, and add this between \<dependencies\>:
Edit `src/main/java/com/example/App.java` and replace it with:
```java
- package com.example;
-
- import java.util.Map;
- import java.io.IOException;
- import fi.iki.elonen.NanoHTTPD;
-
- public class App extends NanoHTTPD {
-
- public App() throws IOException {
- super(8080);
- start();
- System.out.println( "\nRunning! Point your browers to http://localhost:8080/ \n" );
- }
-
- public static void main(String[] args) {
- try {
- new App();
- }
- catch( IOException ioe ) {
- System.err.println( "Couldn't start server:\n" + ioe );
- }
- }
-
- @Override
- public Response serve(IHTTPSession session) {
- String msg = "<html><body><h1>Hello server</h1>\n";
- Map<String, String> parms = session.getParms();
- if (parms.get("username") == null) {
- msg += "<form action='?' method='get'>\n <p>Your name: <input type='text' name='username'></p>\n" + "</form>\n";
- } else {
- msg += "<p>Hello, " + parms.get("username") + "!</p>";
- }
- return newFixedLengthResponse( msg + "</body></html>\n" );
- }
- }
+package com.example;
+
+import java.util.Map;
+import java.io.IOException;
+import fi.iki.elonen.NanoHTTPD;
+
+public class App extends NanoHTTPD {
+
+ public App() throws IOException {
+ super(8080);
+ start();
+ System.out.println( "\nRunning! Point your browers to http://localhost:8080/ \n" );
+ }
+
+ public static void main(String[] args) {
+ try {
+ new App();
+ }
+ catch( IOException ioe ) {
+ System.err.println( "Couldn't start server:\n" + ioe );
+ }
+ }
+
+ @Override
+ public Response serve(IHTTPSession session) {
+ String msg = "<html><body><h1>Hello server</h1>\n";
+ Map<String, String> parms = session.getParms();
+ if (parms.get("username") == null) {
+ msg += "<form action='?' method='get'>\n <p>Your name: <input type='text' name='username'></p>\n" + "</form>\n";
+ } else {
+ msg += "<p>Hello, " + parms.get("username") + "!</p>";
+ }
+ return newFixedLengthResponse( msg + "</body></html>\n" );
+ }
+}
```
Compile and run the server: