GitLab wurde erfolgreich aktualisiert. Durch regelmäßige Updates bleibt das THM GitLab sicher. Danke für Ihre Geduld.

Commit c36a9c59 authored by chrissi's avatar chrissi

sdasd

parent 2a2e687c

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="TypeScriptCompiler">
<option name="isCompilerEnabled" value="true" />
<option name="useConfig" value="true" />
<option name="enableServiceForProjectsWithoutConfig" value="true" />
<option name="recompileOnChanges" value="true" />
</component>
</project>
\ No newline at end of file
<h1
\ No newline at end of file
<h1>Christian Max</h1>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<h1>Christian Max</h1>
</head>
<body>
</body>
</html>
<h1>Christian Max</h1>
<p>Hallo</p>
\ No newline at end of file
......@@ -14,7 +14,32 @@ router.listen(8080, function () {
console.log(" http://localhost:8080/object");
});
router.get("/name", function (req, res) {
res.json({ vorname: "Christian", nachname: "Max" });
res.json({ vorname: "Max", nachname: "Mahr" });
});
router.use("/htmlfile", express.static(__dirname + '/name.html'));
router.get("/gauss", function (req, res) {
var a = 0;
for (var i = 1; i >= 100; i++) {
a += i;
}
res.json({ ergebnis: a });
});
router.get("/liste", function (req, res) {
var Zahlen = [];
for (var i = 1; i <= 100; i++) {
Zahlen.push(i);
}
res.json({ ergebnis: Zahlen });
});
var Person = /** @class */ (function () {
function Person(_vorname, _nachname) {
this.vorname = _vorname;
this.nachname = _nachname;
}
return Person;
}());
router.get("/object", function (req, res) {
var myObject = new Person("Max", "Mahr");
res.json(myObject);
});
router.use("/htmlfile", express.static(__dirname + "/names.html"));
//# sourceMappingURL=server.js.map
\ No newline at end of file
{"version":3,"file":"server.js","sourceRoot":"","sources":["server.ts"],"names":[],"mappings":";;AACA,iCAAoC;AACpC,wCAA2C;AAE3C,IAAI,MAAM,GAAG,OAAO,EAAE,CAAC;AACvB,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI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D,CAAC,AARD,IAQC;AAED,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,GAAY,EAAE,GAAa;IACvD,IAAI,QAAQ,GAAG,IAAI,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACzC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC"}
\ No newline at end of file
......@@ -13,9 +13,44 @@ router.listen(8080, () => {
console.log(" http://localhost:8080/liste");
console.log(" http://localhost:8080/object");
});
router.get("/name", function(req: Request, res: Response){
res.json({vorname: "Christian", nachname: "Max"});
});
router.use("/htmlfile", express.static(__dirname + '/name.html'));
router.get("/gauss", function (req:Request, res: Response){
let a: number = 0;
for (let i=1; i>=100; i++){
a += i
}
res.json({ergebnis: a});
});
router.get("/liste", function (req: Request, res: Response) {
let Zahlen: number[] = [];
router.get("/name", function(req: Request, res:Response) {
res.json({ vorname: "Christian", nachname: "Max"});
for (let i = 1; i <= 100; i++) {
Zahlen.push(i)
}
res.json({ergebnis: Zahlen});
});
router.use("/htmlfile", express.static(__dirname + "/names.html"));
class Person {
public vorname: string;
public nachname: string;
constructor(_vorname: string, _nachname: string) {
this.vorname = _vorname;
this.nachname = _nachname;
}
}
router.get("/object", function (req: Request, res: Response) {
let myObject = new Person("Christian", "Max");
res.json(myObject);
});
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /reset</pre>
</body>
</html>
POST http://localhost:8080/set
Content-Type: application/json
{
"new": "f",
"password": "geheim"
}
<> 2018-04-16T032920.200.json
###
POST http://localhost:8080/set
Content-Type: application/json
{
"new": 7,
"password": "geheijm"
}
<> 2018-04-16T032914.200.json
###
GET http://localhost:8080/cheat/geheim
<> 2018-04-16T032907.200.json
###
GET http://localhost:8080/raten/5
<> 2018-04-16T032905.200.json
###
GET http://localhost:8080/reset
<> 2018-04-16T032903.200.json
###
GET http://localhost:8080/cheat/geheim
<> 2018-04-16T032901.200.json
###
POST http://localhost:8080/set
Content-Type: application/json
{
"new": 7,
"password": "geheim"
}
<> 2018-04-16T032857.200.json
###
GET http://localhost:8080/cheat/geheim
<> 2018-04-16T032850.200.json
###
POST http://localhost:8080/set
Content-Type: application/json
{
"new": 7,
"password": "geheim"
}
<> 2018-04-16T032841.200.json
###
POST http://localhost:8080/set
{
"new": 7,
"password": "geheim"
}
<> 2018-04-16T032832.200.json
###
POST http://localhost:8080/set
{
"new": 7,
"password": "geheim"
}
<> 2018-04-16T032632.200.json
###
POST http://localhost:8080/set
{
"new": 7,
"password": "geheim"
}
<> 2018-04-16T032614.200.json
###
POST http://localhost:8080/set
{
"new": 7,
"password": "geheim"
}
<> 2018-04-16T032528.200.json
###
POST http://localhost:8080/set
{
"new": 7,
"password": "geheim"
}
<> 2018-04-16T032502.200.json
###
GET http://localhost:8080/cheat/geheim
<> 2018-04-16T032459.200.json
###
POST http://localhost:8080/set
{
"new": 7,
"password": "geheim"
}
<> 2018-04-16T032450.200.json
###
GET http://localhost:8080/cheat/geheim
<> 2018-04-16T032350.200.json
###
GET http://localhost:8080/reset
<> 2018-04-16T032349.200.json
###
GET http://localhost:8080/cheat/geheim
<> 2018-04-16T032347.200.json
###
GET http://localhost:8080/reset
<> 2018-04-16T032345.200.json
###
GET http://localhost:8080/cheat/geheim
<> 2018-04-16T032343.200.json
###
GET http://localhost:8080/raten/5
<> 2018-04-16T032330.200.json
###
GET http://localhost:8080/raten/5
<> 2018-04-16T032259.200.json
###
GET http://localhost:8080/reset
<> 2018-04-16T032256.200.json
###
GET http://localhost:8080/reset
<> 2018-04-16T032012.404.html
###
GET http://localhost:8080/cheat/geheim
<> 2018-04-16T032001.200.json
###
GET http://localhost:8080/cheat/geheim2
<> 2018-04-16T031956.200.json
###
GET http://localhost:8080/cheat/geheim
<> 2018-04-16T031950.200.json
###
GET http://localhost:8080/raten/6
<> 2018-04-16T031922.200.json
###
GET http://localhost:8080/raten/5
<> 2018-04-16T031906.200.json
###
......@@ -2,7 +2,7 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/ueabung2_vorlage.iml" filepath="$PROJECT_DIR$/.idea/ueabung2_vorlage.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/uebung2_loesung.iml" filepath="$PROJECT_DIR$/.idea/uebung2_loesung.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
This diff is collapsed.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Aufgabe 2</title>
</head>
<body>
<h1>Zahlenraten</h1>
<input id="zahlenraten">
</body>
</html>
\ No newline at end of file
//# sourceMappingURL=zahl.js.map
\ No newline at end of file
{"version":3,"file":"zahl.js","sourceRoot":"","sources":["zahl.ts"],"names":[],"mappings":""}
\ No newline at end of file
......@@ -5,7 +5,55 @@ var bodyParser = require("body-parser");
var router = express();
router.use(bodyParser.json());
router.use(bodyParser.urlencoded({ extended: true }));
router.listen(8080, function () {
console.log("Gestartet: http://localhost:8080/raten/5");
router.listen(8080);
console.log("Gestartet: http://localhost:8080/Client/zahl.html");
router.use("/site", express.static(__dirname + "/Client"));
function random() {
var min = 1;
var max = 10;
return Math.floor(Math.random() * (max - min)) + min;
}
var target = random();
var password = "geheim";
router.get("/raten/:zahl", function (req, res) {
var geraten = req.params["zahl"];
if (isNaN(geraten)) {
res.json({ antwort: "Fehler!" });
}
else if (geraten > target) {
res.json({ antwort: "Kleiner..." });
}
else if (geraten < target) {
res.json({ antwort: "Größer..." });
}
else {