Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
msveshnikov committed Mar 17, 2024
1 parent 565d527 commit 1d64cd5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
14 changes: 5 additions & 9 deletions server/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import express from "express";
import cors from "cors";
import morgan from "morgan";
import rateLimit from "express-rate-limit";
import morgan from "morgan";
import rateLimit from "express-rate-limit";
import { getTextGemini } from "./gemini.js";
import { getImageTitan } from "./aws.js";

const app = express();
const port = 5000;
const MAX_CONTEXT_LENGTH = 4000;

const app = express();
app.use(cors());
app.use(express.json());

Expand All @@ -19,7 +18,6 @@ app.use(morgan(loggerFormat));
const limiter = rateLimit({
windowMs: 60 * 1000,
max: 10,
message: "Too many requests from this IP, please try again after a minute",
});

app.use(limiter);
Expand All @@ -43,13 +41,11 @@ app.post("/interact", async (req, res) => {
} catch (error) {
console.error(error);
res.status(500).json({
error: "An error occurred while interacting with the Gemini Pro model",
error: "Gemini Pro Error",
});
}
});

app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});
app.listen(5000);

process.env["GOOGLE_APPLICATION_CREDENTIALS"] = "./google.json";
20 changes: 20 additions & 0 deletions src/theme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { red } from "@mui/material/colors";
import { createTheme } from "@mui/material/styles";

const theme = (mode) =>
createTheme({
palette: {
mode: mode,
primary: {
main: "#F50057",
},
secondary: {
main: "#673ab7",
},
error: {
main: red.A400,
},
},
});

export default theme;

0 comments on commit 1d64cd5

Please sign in to comment.