mirror of
https://github.com/l5yth/potato-mesh.git
synced 2026-07-06 18:01:19 +02:00
be5365105d
* web: fix api/events hang on shutdown * web: address review comments
23 lines
958 B
Ruby
23 lines
958 B
Ruby
# Copyright © 2025-26 l5yth & contributors
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
# frozen_string_literal: true
|
|
|
|
require_relative "lib/potato_mesh/application"
|
|
|
|
# Boot when run directly. run_server! installs INT/TERM handlers that close the
|
|
# live-update SSE streams on shutdown -- so Ctrl+C is not blocked by an open
|
|
# /api/events connection -- before handing off to Sinatra's run!.
|
|
PotatoMesh::Application.run_server! if $PROGRAM_NAME == __FILE__
|