swifter
swifter copied to clipboard
CORS for files
I have looked at the other issues that involve adding CORS to the server but they didn't help.
One of the other issue's answer was the following, Is there any way to use the .ShareDirectory features with it?
server["/cors"] = { _ in
return .raw(200, "OK", ["Access-Control-Allow-Origin": "*"], { writer in
try? writer.write([UInt8]("hello".utf8))
})
}