package sh.adb.RandomRedditMemesAPI; import com.github.jreddit.oauth.RedditOAuthAgent; import com.github.jreddit.oauth.RedditToken; import com.github.jreddit.oauth.app.RedditApp; import com.github.jreddit.oauth.app.RedditInstalledApp; import com.github.jreddit.oauth.exception.RedditOAuthException; import com.sun.net.httpserver.HttpServer; import org.json.simple.parser.ParseException; import java.io.IOException; import java.net.InetSocketAddress; public class Main { public static void main(String[] args) throws IOException, RedditOAuthException, ParseException { HttpServer server = HttpServer.create(new InetSocketAddress(8000), 0); server.createContext("/", new FallbackHandler()); //server.createContext("/api/v1/", new StandardHandler()); server.createContext("/api/v1/r/", new CommunityHandler()); server.setExecutor(null); server.start(); System.out.println("server started"); RedditAPI client = new RedditAPI(); System.out.println("the token is"); System.out.println(client.token.getAccessToken()); } }