Stephan Pleines | 31f98da | 2024-05-22 17:31:23 -0700 | [diff] [blame] | 1 | #include <memory> |
| 2 | |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 3 | #include "absl/flags/flag.h" |
Philipp Schrader | 790cb54 | 2023-07-05 21:06:52 -0700 | [diff] [blame] | 4 | |
James Kuszmaul | 3398d0b | 2023-02-11 22:55:22 -0800 | [diff] [blame] | 5 | #include "aos/init.h" |
| 6 | #include "aos/seasocks/seasocks_logger.h" |
James Kuszmaul | 3398d0b | 2023-02-11 22:55:22 -0800 | [diff] [blame] | 7 | #include "internal/Embedded.h" |
Stephan Pleines | 31f98da | 2024-05-22 17:31:23 -0700 | [diff] [blame] | 8 | #include "seasocks/Logger.h" |
James Kuszmaul | 3398d0b | 2023-02-11 22:55:22 -0800 | [diff] [blame] | 9 | #include "seasocks/Server.h" |
| 10 | |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 11 | ABSL_FLAG(std::string, data_path, "external/foxglove_studio", |
| 12 | "Path to foxglove studio files to serve."); |
| 13 | ABSL_FLAG(uint32_t, port, 8000, "Port to serve files at."); |
James Kuszmaul | 3398d0b | 2023-02-11 22:55:22 -0800 | [diff] [blame] | 14 | |
| 15 | int main(int argc, char *argv[]) { |
| 16 | aos::InitGoogle(&argc, &argv); |
| 17 | // Magic for seasocks. |
| 18 | findEmbeddedContent(""); |
| 19 | ::seasocks::Server server(std::make_shared<aos::seasocks::SeasocksLogger>( |
| 20 | ::seasocks::Logger::Level::Info)); |
Austin Schuh | 99f7c6a | 2024-06-25 22:07:44 -0700 | [diff] [blame] | 21 | server.serve(absl::GetFlag(FLAGS_data_path).c_str(), |
| 22 | absl::GetFlag(FLAGS_port)); |
James Kuszmaul | 3398d0b | 2023-02-11 22:55:22 -0800 | [diff] [blame] | 23 | } |