You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
782 B
Java
25 lines
782 B
Java
package sh.adb.RandomRedditMemesAPI;
|
|
|
|
import com.github.jreddit.oauth.exception.RedditOAuthException;
|
|
import com.sun.net.httpserver.HttpServer;
|
|
|
|
import java.io.IOException;
|
|
import java.net.InetSocketAddress;
|
|
|
|
public class Main {
|
|
public static void main(String[] args) throws IOException, RedditOAuthException {
|
|
HttpServer server = HttpServer.create(new InetSocketAddress(8000), 0);
|
|
server.createContext("", new ErrorHandler());
|
|
//server.createContext("/api/v1/", new StandardHandler());
|
|
server.createContext("/api/v1/r/", new CommunityHandler());
|
|
server.setExecutor(null);
|
|
server.start();
|
|
|
|
RedditAPI client = new RedditAPI();
|
|
System.out.println("the token is");
|
|
System.out.println(client.token);
|
|
}
|
|
}
|
|
|
|
|