forked from polis-vk/2024-highload-dht
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathServer.java
30 lines (23 loc) · 832 Bytes
/
Server.java
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
package ru.vk.itmo.test.volkovnikita;
import ru.vk.itmo.ServiceConfig;
import ru.vk.itmo.dao.Config;
import ru.vk.itmo.test.reference.dao.ReferenceDao;
import java.io.IOException;
import java.nio.file.Files;
import java.util.List;
public final class Server {
public static final long FLUSH_THRESHOLD_BYTES = 4 * 1024L;
private Server() {
}
public static void main(String[] args) throws IOException {
ServiceConfig config = new ServiceConfig(
8080,
"http://localhost",
List.of("http://localhost"),
Files.createTempDirectory(".")
);
ReferenceDao dao = new ReferenceDao(new Config(config.workingDir(), FLUSH_THRESHOLD_BYTES));
HttpServerImpl server = new HttpServerImpl(config, dao);
server.start();
}
}