-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
31 lines (25 loc) · 653 Bytes
/
Copy pathmain.cpp
File metadata and controls
31 lines (25 loc) · 653 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "database.h"
#include "lodepng.h"
#include "routes.h"
#include <chrono>
#include <crow.h>
#include <crow/http_response.h>
#include <crow/mustache.h>
#include <iostream>
#include <sqlite3.h>
#include <string>
#include <vector>
void debug(const char *s) { std::cout << "DEBUG: " << s << std::endl; }
void debug(std::string s) { std::cout << "DEBUG: " << s << std::endl; }
int main() {
crow::SimpleApp app;
sqlite3 *db = nullptr;
if (create_database() != SQLITE_OK) {
std::cout << "FATAL: FAILED TO CREATE DATABASE\n";
return 1;
}
def_routes(app);
app.port(8080).multithreaded().run();
sqlite3_close(db);
return 0;
}