import ApiService from "../services/api.js";
import config from '../config.js';

class ApiController {
    async getChatMessages(req, res) {
        const {limit, offset} = req.params;

        const messages = await ApiService.getChatMessages(limit, offset);

        return res.status(200).send(messages);
    }

    async getWebsocketConnection(req, res) {
        return res.status(200).send(config.ws_connection_string);
    }

    async getSkinsUrl(req, res) {
        return res.status(200).send(config.skins_url);
    }

    async getCapesUrl(req, res) {
        return res.status(200).send(config.capes_url);
    }
}

export default new ApiController();