Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilVorre committed May 21, 2024
1 parent 561819c commit 61efd20
Show file tree
Hide file tree
Showing 30 changed files with 14,342 additions and 7 deletions.
3 changes: 0 additions & 3 deletions Backend/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,9 @@ server.post("/get_small_text_about_education", (request: Request, response: Resp

// calculate small text function here:
let smallText;
console.log("education", education)
getHeadliner(education.url).then((text) => {
smallText = text;

response.status(200).send(smallText.headlinerText);

}
).catch((error) => {
console.error("Error in /get_small_text_about_education:", error);
Expand Down
12 changes: 12 additions & 0 deletions Backend/server/server.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import express from 'express';

const app = express();
const port = 3000;

app.get('/', (req, res) => {
res.send('Hello, World!');
});

app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});
3 changes: 0 additions & 3 deletions Backend/server/useServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const useServer = () => {
// write more functions here

const getSmallTextAboutEducation = async (education: Education) => {
console.log("education", education)

const response = await fetch("http://localhost:1337/get_small_text_about_education", {
method: "POST",
Expand All @@ -52,9 +51,7 @@ const useServer = () => {
},
body: JSON.stringify({ education })
});
console.log("response", response)
const smallText = await response.text();
console.log("smallText", smallText)
return smallText;
}

Expand Down
Loading

0 comments on commit 61efd20

Please sign in to comment.