<commit_before>% This file is part of "Enms" (http://sourceforge.net/projects/enms/)
% Copyright (C) 2012 <<NAME> <EMAIL>>
%
% Enms is a Network Management System aimed to manage and monitor SNMP
% targets, monitor network hosts and services, provide a consistent
% documentation system and tools to help network professionals
% to have a wide perspective of the networks they manage.
%
% Enms is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Enms is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Enms.  If not, see <http://www.gnu.org/licenses/>.
% @private
-module(supercast_app).
-behaviour(application).

-export([start/2, stop/1]).

start(_Type, _Args) ->
    Ret = supercast_sup:start_link(),
	start_listening(),
	Ret.

stop(_State) ->
	ok.

start_listening() ->
    {ok, DocRoot} = application:get_env(supercast, http_docroot),
    DocrootPath = filename:absname(DocRoot),
    DocrootIndex = filename:join(DocrootPath, "index.html"),
	Dispatch = cowboy_router:compile([
		{'_', [
            {"/", cowboy_static, {file, DocrootIndex}},
			{"/[...]", cowboy_static, {dir, DocrootPath}},
			{"/websocket", ranch_websocket_endpoint, []}
		]}
	]),

    {ok, HTTPPort} = application:get_env(supercast, http_port),
	{ok, _} = cowboy:start_http(supercast_http, 10,
        [{port, HTTPPort}],[{env, [{dispatch, Dispatch}]}]),

	{ok, TCPPort} = application:get_env(supercast, tcp_port),
    {ok, _} = ranch:start_listener(supercast_tcp, 10, ranch_tcp,
        [{port, TCPPort}], ranch_tcp_endpoint, []).
<commit_msg>new routing routes ordering, compress static<commit_after>% This file is part of "Enms" (http://sourceforge.net/projects/enms/)
% Copyright (C) 2012 <<NAME> <EMAIL>>
%
% Enms is a Network Management System aimed to manage and monitor SNMP
% targets, monitor network hosts and services, provide a consistent
% documentation system and tools to help network professionals
% to have a wide perspective of the networks they manage.
%
% Enms is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Enms is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Enms.  If not, see <http://www.gnu.org/licenses/>.
% @private
-module(supercast_app).
-behaviour(application).

-export([start/2, stop/1]).

start(_Type, _Args) ->
    Ret = supercast_sup:start_link(),
	start_listening(),
	Ret.

stop(_State) ->
	ok.

start_listening() ->
    {ok, DocRoot} = application:get_env(supercast, http_docroot),
    DocrootPath = filename:absname(DocRoot),
    DocrootIndex = filename:join(DocrootPath, "index.html"),
	Dispatch = cowboy_router:compile([
		{'_', [
			{"/websocket", ranch_websocket_endpoint, []},
            {"/", cowboy_static, {file, DocrootIndex}},
			{"/[...]", cowboy_static, {dir, DocrootPath}}
		]}
	]),

    {ok, HTTPPort} = application:get_env(supercast, http_port),
	{ok, _} = cowboy:start_http(supercast_http, 10,
        [{port, HTTPPort}],[{compress,true}, {env, [{dispatch, Dispatch}]}]),

	{ok, TCPPort} = application:get_env(supercast, tcp_port),
    {ok, _} = ranch:start_listener(supercast_tcp, 10, ranch_tcp,
        [{port, TCPPort}], ranch_tcp_endpoint, []).

{'fraction_non_alphanumeric': 0.12550301810865191, 'fraction_numerical': 0.005533199195171026, 'mean_word_length': 4.440492476060191, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1420558', 'n_tokens_mistral': 1249, 'n_tokens_neox': 1213, 'n_words': 412}