aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/frontend/frontend.h
blob: 6d8585b72bfc1ce9d666f68ffbaef18f6761aed0 (plain) (blame)
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
// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include <zenhttp/httpserver.h>
#include <zenhttp/httpstatus.h>
#include "zipfs.h"

#include <filesystem>
#include <memory>

namespace zen {

class HttpFrontendService final : public zen::HttpService, public IHttpStatusProvider
{
public:
	HttpFrontendService(std::filesystem::path Directory, HttpStatusService& StatusService);
	virtual ~HttpFrontendService();
	virtual const char* BaseUri() const override;
	virtual void		HandleRequest(zen::HttpServerRequest& Request) override;
	virtual void		HandleStatusRequest(HttpServerRequest& Request) override;

private:
	std::unique_ptr<ZipFs> m_ZipFs;
	std::filesystem::path  m_Directory;
	HttpStatusService&	   m_StatusService;
};

}  // namespace zen