code: @SuppressForbidden(reason = "Allow to exit the application with a return code here")
  	public static void main( String[] args ) throws IOException
  	{
  		System.out.println( "NanoHTTPD 1.14 (C) 2001,2005-2010 Jarno Elonen\n" +
  							"(Command line options: [port] [--licence])\n" );
  
  		// Show licence if requested
  		int lopt = -1;
  		for ( int i=0; i<args.length; ++i ) {
  			if ( args[i].toLowerCase().endsWith( "licence" ))
  			{
  				lopt = i;
  				System.out.println( LICENCE + "\n" );
  			}
  		}
  
  		// Change port if requested
  		int port = 80;
  		if ( args.length > 0 && lopt != 0 ) {
  			port = Integer.parseInt( args[0] );
  		}
  
  		if ( args.length > 1 &&
  			 args[1].toLowerCase().endsWith( "licence" )) {
  			System.out.println( LICENCE + "\n" );
  		}
  
  		final NanoHTTPD nh;
  		try
  		{
  			nh = new NanoHTTPD( port );
  		}
  		catch( IOException ioe )
  		{
  			System.err.println( "Couldn't start server:\n" + ioe );
  			System.exit( -1 );
  			return;
  		}
  
  		System.out.println( "Now serving files in port " + port + " from \"" +
  							new File("").getAbsolutePath() + "\"" );
  		System.out.println( "Hit Enter to stop.\n" );
  
  		try {
  			System.in.read();
  		} finally {
  			nh.stop();
  		}
  	}
docs: Starts as a standalone file server and waits for Enter.
  
  @param args The commandline arguments, e.g. for specifying the port
  
  @throws IOException If starting the web-server fails.