Skip to content

Commit

Permalink
web-app: Code improvements
Browse files Browse the repository at this point in the history
- separating Server and Client concerns in next.js
- Setupping eslint
- renaming CamelCase files into snake-case
  • Loading branch information
jurabek committed Jan 6, 2024
1 parent 948042a commit 8d71efa
Show file tree
Hide file tree
Showing 36 changed files with 1,671 additions and 530 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,8 @@ public static IWebHost MigrateDbContext<TContext>(this IWebHost webHost, Action<
}
catch (Exception ex)
{
if (k8s)
{
throw ex;
}
logger.LogError(ex, $"An error occurred while migrating the database used on context {typeof(TContext).Name}");
throw ex;
}
}

Expand Down
23 changes: 22 additions & 1 deletion src/backend/web/web.client/web-app-new/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
{
"extends": "next/core-web-vitals"
"extends": ["next", "prettier"],
"plugins": ["unicorn"],
"rules": {
"no-unused-vars": [
"error",
{
"args": "after-used",
"caughtErrors": "none",
"ignoreRestSiblings": true,
"vars": "all",
"argsIgnorePattern": "^_"
}
],
"prefer-const": "error",
"react-hooks/exhaustive-deps": "error",
"unicorn/filename-case": [
"error",
{
"case": "kebabCase"
}
]
}
}
34 changes: 17 additions & 17 deletions src/backend/web/web.client/web-app-new/next.config.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "standalone",
output: 'standalone',
logging: {
fetches: {
fullUrl: true,
},
fullUrl: true
}
},
images: {
remotePatterns: [
{
protocol: "https",
hostname: "img.buzzfeed.com",
protocol: 'https',
hostname: 'img.buzzfeed.com'
},
{
protocol: "http",
hostname: "localhost",
protocol: 'http',
hostname: 'localhost'
},
{
protocol: "http",
hostname: "traefik",
protocol: 'http',
hostname: 'traefik'
},
{
protocol: "http",
hostname: "host.docker.internal"
protocol: 'http',
hostname: 'host.docker.internal'
}
],
]
},

async redirects() {
return [
{
source: "/",
destination: "/foods",
permanent: true,
},
source: '/',
destination: '/foods',
permanent: true
}
];
},
}
};

module.exports = nextConfig;
Loading

0 comments on commit 8d71efa

Please sign in to comment.