More updates

This commit is contained in:
Panayiotis Lipiridis 2021-01-18 23:53:26 +02:00
parent 9e268b9e03
commit eabeb2c1a1
3 changed files with 13 additions and 15 deletions

View File

@ -1,13 +0,0 @@
FROM node:12-alpine
WORKDIR /excalidraw-room
COPY package.json yarn.lock ./
RUN yarn
COPY tsconfig.json ./
COPY src ./src
RUN yarn build
EXPOSE 80
CMD ["yarn", "start"]

View File

@ -1 +1,12 @@
runtime: nodejs14 runtime: nodejs14
env: flex
# https://cloud.google.com/appengine/docs/flexible/nodejs/configuring-your-app-with-app-yaml
manual_scaling:
instances: 1
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 10
network:
session_affinity: true

View File

@ -22,10 +22,10 @@ server.listen(port, () => {
const io = socketIO(server, { const io = socketIO(server, {
handlePreflightRequest: function (req, res) { handlePreflightRequest: function (req, res) {
console.log('req', req.header);
var headers = { var headers = {
"Access-Control-Allow-Headers": "Content-Type, Authorization", "Access-Control-Allow-Headers": "Content-Type, Authorization",
"Access-Control-Allow-Origin": "Access-Control-Allow-Origin": "*",
(req.header && req.header.origin) || "https://excalidraw.com",
"Access-Control-Allow-Credentials": true, "Access-Control-Allow-Credentials": true,
}; };
res.writeHead(200, headers); res.writeHead(200, headers);