Skip to content

Commit

Permalink
fix: js minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
thuongtruong1009 committed Feb 29, 2024
1 parent 402070f commit d10a485
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
8 changes: 5 additions & 3 deletions api/load_balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,12 @@ func LoadBalancer(proxyPort string, backends []Backend) {
go HealthCheck()

s := http.Server{
Addr: ":" + cfg.ProxyPort,
Handler: http.HandlerFunc(lbHandler),
Addr: ":" + cfg.ProxyPort,
Handler: http.HandlerFunc(lbHandler),
ReadHeaderTimeout: 10 * time.Second, // Set an appropriate timeout value
}

if err := s.ListenAndServe(); err != nil {
log.Fatal(err.Error())
log.Printf("Error starting server: %s", err.Error())
}
}
6 changes: 3 additions & 3 deletions docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type * as Preset from "@docusaurus/preset-classic";
import * as Preset from "@docusaurus/preset-classic";
import type { Config } from "@docusaurus/types";
import { themes as prismThemes } from "prism-react-renderer";

Expand Down Expand Up @@ -136,7 +136,7 @@ const config: Config = {
],
},
],
copyright: `Copyright © 2024 Gouse ❤️`,
copyright: "Copyright © 2024 Gouse ❤️",
},
prism: {
theme: prismThemes.github,
Expand All @@ -150,7 +150,7 @@ const config: Config = {
} satisfies Preset.ThemeConfig,

plugins: [
async function myPlugin(context, options) {
function myPlugin(_context, _options) {
return {
name: "docusaurus-tailwindcss",
configurePostCss(postcssOptions) {
Expand Down
8 changes: 6 additions & 2 deletions docs/src/components/HomepageFeatures/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import clsx from "clsx";
import styles from "./styles.module.css";

type FeatureItem = {
_id: string;
title: string;
Svg: React.ComponentType<React.ComponentProps<"svg">>;
description: JSX.Element;
};

const FeatureList: FeatureItem[] = [
{
_id: "1",
title: "Easy to Use",
Svg: require("@site/static/img/undraw_docusaurus_mountain.svg").default,
description: (
Expand All @@ -19,6 +21,7 @@ const FeatureList: FeatureItem[] = [
),
},
{
_id: "2",
title: "Focus on What Matters",
Svg: require("@site/static/img/undraw_docusaurus_tree.svg").default,
description: (
Expand All @@ -29,6 +32,7 @@ const FeatureList: FeatureItem[] = [
),
},
{
_id: "3",
title: "Powered by React",
Svg: require("@site/static/img/undraw_docusaurus_react.svg").default,
description: (
Expand Down Expand Up @@ -59,8 +63,8 @@ export default function HomepageFeatures(): JSX.Element {
<section className={styles.features}>
<div className="container">
<div className="row">
{FeatureList.map((props, idx) => (
<Feature key={idx} {...props} />
{FeatureList.map((props) => (
<Feature key={props._id} {...props} />
))}
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ function HomepageHeader() {
</Heading>
<p className="hero__subtitle">{siteConfig.tagline}</p>
<div className="flex justify-center items-center space-x-4">
{buttons.map((button) => (
<button className={styles.buttons}>
{buttons.map((button, idx) => (
<button className={styles.buttons} key={idx}>
<Link
className="button button--secondary button--lg"
to={button.link}
Expand Down

0 comments on commit d10a485

Please sign in to comment.