entry.cpp 572 B

1234567891011121314151617181920212223
  1. #include <iostream>
  2. #include "core/fastweb.h"
  3. #include "util/system.h"
  4. #include "core/define.h"
  5. #include "core/config.h"
  6. extern "C" {
  7. __declspec(dllexport) int fastweb(const char* config_filepath)
  8. {
  9. std::cout << "=========== [fastweb engine] ============" << std::endl;
  10. if (sConfig->open(config_filepath) == false)
  11. {
  12. LOG_ERROR("open config failed," + sConfig->last_error());
  13. return -1;
  14. }
  15. if (fastweb::getInstance()->start() == false)
  16. {
  17. LOG_ERROR("fastweb start failed," + fastweb::getInstance()->last_error());
  18. return -1;
  19. }
  20. return 0;
  21. }
  22. }