This commit is contained in:
Mihovil Ilakovac 2024-10-29 15:10:18 +01:00
parent 80baf9c3b1
commit fb899a09ea
2 changed files with 2 additions and 13 deletions

View File

@ -1,4 +1,3 @@
{{={= =}=}}
import { stripTrailingSlash } from '../universal/url.js'
import { env } from './env.js'

View File

@ -66,7 +66,6 @@ import Wasp.Generator.WebAppGenerator.Common
reactRouterVersion,
reactVersion,
)
import qualified Wasp.Generator.WebAppGenerator.Common as WebApp
import qualified Wasp.Node.Version as NodeVersion
import Wasp.Project.Common (WaspProjectDir)
import qualified Wasp.Project.Db as Db
@ -100,7 +99,7 @@ genSdk spec =
genFileCopy [relfile|client/test/index.ts|],
genFileCopy [relfile|client/index.ts|],
genFileCopy [relfile|dev/index.ts|],
genClientConfigFile,
genFileCopy [relfile|client/config.ts|],
genServerConfigFile spec,
genTsConfigJson,
genServerUtils spec,
@ -249,18 +248,9 @@ genServerConfigFile spec = return $ C.mkTmplFdWithData relConfigFilePath tmplDat
tmplData =
object
[ "isAuthEnabled" .= isAuthEnabled spec,
"databaseUrlEnvVarName" .= Db.databaseUrlEnvVarName,
"defaultClientUrl" .= WebApp.getDefaultDevClientUrl spec,
"defaultServerUrl" .= Server.defaultDevServerUrl,
"defaultServerPort" .= Server.defaultServerPort
"databaseUrlEnvVarName" .= Db.databaseUrlEnvVarName
]
genClientConfigFile :: Generator FileDraft
genClientConfigFile = return $ C.mkTmplFdWithData relConfigFilePath tmplData
where
relConfigFilePath = [relfile|client/config.ts|]
tmplData = object ["defaultServerUrl" .= Server.defaultDevServerUrl]
-- todo(filip): remove this duplication, we have almost the same thing in the
-- ServerGenerator.
genTsConfigJson :: Generator FileDraft