view mlk-server/main.cpp @ 193:209bdaa13a49

Tests: rename directories to match targets
author David Demelier <markand@malikania.fr>
date Sat, 27 Oct 2018 07:16:28 +0200
parents server/main.cpp@ffe8ac5c35c0
children 9ef01392a7f1
line wrap: on
line source

/*
 * main.cpp -- main server executable file
 *
 * Copyright (c) 2013-2018 David Demelier <markand@malikania.fr>
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#include <iostream>

#include <malikania/db/database.hpp>
#include <malikania/db/account.hpp>

#include <malikania/server/server.hpp>

using namespace mlk;

int main()
{
	boost::asio::io_context ctx;

	try {
		server::settings settings;

		settings.key = "/home/markand/server.key";
		settings.certificate = "/home/markand/server.crt";
		settings.port = 3320;
		
		server::server sv(ctx, settings);

		db::open("", "", "markand", "malikaniadb", "");
		db::init();
		
		ctx.run();
	} catch (const std::exception& ex) {
		std::cerr << "abort: " << ex.what() << std::endl;
	}
}