package dev.peerat.backend.routes;

import java.util.regex.Matcher;

import dev.peerat.backend.Configuration;
import dev.peerat.backend.bonus.extract.RouteExtracter;
import dev.peerat.framework.Context;
import dev.peerat.framework.HttpReader;
import dev.peerat.framework.HttpWriter;
import dev.peerat.framework.Injection;
import dev.peerat.framework.Response;
import dev.peerat.framework.Route;

public class Swagger implements Response{
	
	private String json;
	
	public Swagger(RouteExtracter extracter, Configuration config){
		try{
//			this.json = extracter.swagger(config.getTokenIssuer()).toString();
		}catch(Exception e){
			e.printStackTrace();
			json = "{}";
		}
	}

	@Route(path = "^/swagger$")
	public void exec(Matcher matcher, Context context, HttpReader reader, HttpWriter writer) throws Exception {
		context.response(200);
		writer.write(json);
	}
	
	

}
