/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.etsi.saref.server;

import com.github.mustachejava.DefaultMustacheFactory;
import com.github.mustachejava.MustacheFactory;
import com.github.mustachejava.MustacheResolver;
import com.github.mustachejava.resolver.DefaultResolver;
import javax.ws.rs.ApplicationPath;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.server.mvc.mustache.MustacheMvcFeature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author maxime.lefrancois
 */
@ApplicationPath("")
public class SAREFResourceConfig extends ResourceConfig {

    private static final Logger LOG = LoggerFactory.getLogger(SAREFResourceConfig.class);
    
    public SAREFResourceConfig() {
        property(MustacheMvcFeature.TEMPLATE_BASE_PATH, "/templates");
        MustacheResolver resolver = new DefaultResolver(".");
        MustacheFactory factory = new DefaultMustacheFactory(resolver);
        property(MustacheMvcFeature.TEMPLATE_OBJECT_FACTORY, factory);
        register(MustacheMvcFeature.class);
        packages(true, "org.etsi.saref.server.resources");
    }

}
