Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions assignments/config-files/hackyourtemperature/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "hackyourtemperature",
"version": "1.0.0",
"type": "module",
"description": "",
"main": "server.js",
"scripts": {
"start": "node server.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"express": "^5.1.0",
"express-handlebars": "^8.0.3",
"node-fetch": "^3.3.2"
}
}
17 changes: 17 additions & 0 deletions assignments/config-files/hackyourtemperature/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import express from "express";

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

app.get("/", (req, res) => {
res.send("hello from backend to frontend!");
});

app.post("/weather", (req, res) => {
const cityName = req.body.cityName;
res.send(`You sent: ${cityName}`);
});

app.listen(3000, () => {
console.log("Server running on http://localhost:3000");
});
20 changes: 20 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "node.js-cohort54",
"version": "1.0.0",
"description": "> If you are following the HackYourFuture curriculum we recommend you to start with module 1: [HTML/CSS/GIT](https://github.com/HackYourFuture/HTML-CSS). To get a complete overview of the HackYourFuture curriculum first, click [here](https://github.com/HackYourFuture/curriculum).",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Hadidreem17/Node.js-Cohort54.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/Hadidreem17/Node.js-Cohort54/issues"
},
"homepage": "https://github.com/Hadidreem17/Node.js-Cohort54#readme"
}