diff options
author | Jarno Elonen <elonen@iki.fi> | 2015-07-05 14:49:11 +0300 |
---|---|---|
committer | Jarno Elonen <elonen@iki.fi> | 2015-07-05 14:49:11 +0300 |
commit | 582a893592ac2bd2360d753393421dd0680067cf (patch) | |
tree | e478ecd6160006011b8d23e39d5c9b3bc91ad783 /README.md | |
parent | 7745b7553684a783331afa725557dbe6a09df5b0 (diff) | |
download | nanohttpd-582a893592ac2bd2360d753393421dd0680067cf.tar.gz |
Removed spurious indent.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 70 |
1 files changed, 35 insertions, 35 deletions
@@ -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: |