This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// aliases | |
type MyEvent = PingEvent | MessageEvent; | |
type EventTypes = MyEvent["type"]; | |
type EventHandler<T> = (payload: T) => void; | |
type EventHandlers = { | |
ping: EventHandler<PingEvent>[]; | |
message: EventHandler<MessageEvent>[]; | |
}; | |
// type defs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http { | |
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} | |
upstream local_origin { | |
server localhost:5173; | |
# I was using this for Vite HMR backend. | |
# For Vite HMR ws proxy, see: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('test!') |