Merge pull request #236 from kiwix/return-port-kiwix-serve

kiwix local server port can be set at the constructor
This commit is contained in:
Matthieu Gautier 2019-06-27 17:59:14 +02:00 committed by GitHub
commit f41155e060
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -9,12 +9,13 @@ namespace kiwix {
class KiwixServe class KiwixServe
{ {
public: public:
KiwixServe(); KiwixServe(int port = 8181);
~KiwixServe(); ~KiwixServe();
void run(); void run();
void shutDown(); void shutDown();
bool isRunning(); bool isRunning();
int getPort() { return m_port; }
private: private:
std::unique_ptr<Subprocess> mp_kiwixServe; std::unique_ptr<Subprocess> mp_kiwixServe;

View File

@ -13,7 +13,7 @@
namespace kiwix { namespace kiwix {
KiwixServe::KiwixServe() : m_port(8181) KiwixServe::KiwixServe(int port) : m_port(port)
{ {
} }