1
0
Fork 0
mirror of synced 2024-06-01 18:20:18 +12:00

Enable hot reloading of server typescript and fix error when updating app and nmot providing a name

This commit is contained in:
Andrew Kingston 2021-06-29 08:20:17 +01:00
parent 2b7f3942d0
commit 76c42c4094
3 changed files with 12 additions and 3 deletions

View file

@ -0,0 +1,6 @@
{
"watch": ["src"],
"ext": "js,ts,json",
"ignore": ["src/**/*.spec.ts", "src/**/*.spec.js"],
"exec": "ts-node src/index.ts"
}

View file

@ -18,7 +18,7 @@
"dev:stack:up": "node scripts/dev/manage.js up",
"dev:stack:down": "node scripts/dev/manage.js down",
"dev:stack:nuke": "node scripts/dev/manage.js nuke",
"dev:builder": "yarn run dev:stack:up && ts-node src/index.ts",
"dev:builder": "yarn run dev:stack:up && nodemon",
"format": "prettier --config ../../.prettierrc.json 'src/**/*.ts' --write",
"lint": "eslint --fix src/",
"lint:fix": "yarn run format && yarn run lint",

View file

@ -67,15 +67,18 @@ async function getAppUrlIfNotInUse(ctx) {
let url
if (ctx.request.body.url) {
url = encodeURI(ctx.request.body.url)
} else {
} else if (ctx.request.body.name) {
url = encodeURI(`${ctx.request.body.name}`)
}
url = `/${url.replace(URL_REGEX_SLASH, "")}`.toLowerCase()
if (url) {
url = `/${url.replace(URL_REGEX_SLASH, "")}`.toLowerCase()
}
if (!env.SELF_HOSTED) {
return url
}
const deployedApps = await getDeployedApps(ctx)
if (
url &&
deployedApps[url] != null &&
deployedApps[url].appId !== ctx.params.appId
) {