Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Automatic database synchronization (#225)

Yevhenii Kulisidicdb1e9ff9ded
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
new file mode 100644
index 000000000..51ae65290
--- /dev/null
+++ b/.devcontainer/devcontainer.json
@@ -0,0 +1,10 @@
+{
+ "name": "Swetrix API",
+ "image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye",
+ "features": {
+ "ghcr.io/devcontainers/features/docker-in-docker:2": {},
+ "ghcr.io/devcontainers-contrib/features/nestjs-cli:2": {}
+ },
+ "forwardPorts": [5005],
+ "postCreateCommand": "npm install --legacy-peer-deps"
+}
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
new file mode 100644
index 000000000..c83e26348
--- /dev/null
+++ b/.vscode/extensions.json
@@ -0,0 +1,3 @@
+{
+ "recommendations": ["esbenp.prettier-vscode"]
+}
diff --git a/apps/production/src/app.module.ts b/apps/production/src/app.module.ts
index 4d3918b83..664379534 100644
--- a/apps/production/src/app.module.ts
+++ b/apps/production/src/app.module.ts
@@ -21,7 +21,6 @@ import { getI18nConfig } from './configs'
import { AuthModule } from './auth/auth.module'
import { CaptchaModule } from './captcha/captcha.module'
import { OgImageModule } from './og-image/og-image.module'
-// import { isDevelopment } from './common/constants'
import { IntegrationsModule } from './integrations/integrations.module'
const modules = [
@@ -38,7 +37,7 @@ const modules = [
username: process.env.MYSQL_USER,
password: process.env.MYSQL_ROOT_PASSWORD,
database: process.env.MYSQL_DATABASE,
- synchronize: false, // isDevelopment,
+ synchronize: process.env.NODE_ENV !== 'production',
entities: [`${__dirname}/**/*.entity{.ts,.js}`],
}),
I18nModule.forRootAsync(getI18nConfig()),