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

Commit 6142bfd8 authored by Tung Vu's avatar Tung Vu

update

parent c36a9c59

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
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectTasksOptions">
<TaskOptions isEnabled="true">
<option name="arguments" value="$FilePathRelativeToProjectRoot$ --out-dir dist --source-maps --presets env" />
<option name="checkSyntaxErrors" value="true" />
<option name="description" />
<option name="exitCodeBehavior" value="ERROR" />
<option name="fileExtension" value="js" />
<option name="immediateSync" value="true" />
<option name="name" value="Babel" />
<option name="output" value="dist\$FileDirRelativeToProjectRoot$\$FileNameWithoutExtension$.js:dist\$FileDirRelativeToProjectRoot$\$FileNameWithoutExtension$.js.map" />
<option name="outputFilters">
<array />
</option>
<option name="outputFromStdout" value="false" />
<option name="program" value="" />
<option name="scopeName" value="Project Files" />
<option name="trackOnlyRoot" value="false" />
<option name="workingDir" value="$ContentRoot$" />
<envs />
</TaskOptions>
</component>
</project>
\ No newline at end of file
This diff is collapsed.
<h1>Quang Tung Vu</h1>
<p>SMS WS 17 18</p>
\ No newline at end of file
<h1>Max Mahr</h1>
<p>Hallo</p>
\ No newline at end of file
......@@ -13,15 +13,33 @@ router.listen(8080, function () {
console.log(" http://localhost:8080/liste");
console.log(" http://localhost:8080/object");
});
var Person = (function () {
router.get("/name", function (req, res) {
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) {
let mobject = new Person("Dieter", "Hammer");
res.json(mobject);
router.get("/object", function (req, res) {
var myObject = new Person("Max", "Mahr");
res.json(myObject);
});
//# 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;AAC3C,IAAI,MAAM,GAAG,OAAO,EAAE,CAAC;AACvB,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;AAC9B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;IAClB,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC1B,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;IAC5C,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;AAChD,CAAC,CAAC,CAAC;AAEH;IAIE,gBAAY,QAAe,EAAE,SAAiB;QAC5C,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC5B,CAAC;IACH,aAAC;AAAD,CAAC,AARD,IAQC"}
\ No newline at end of file
{"version":3,"file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AAG,CAAC,QAAQ,EAAE,UAAU,GAAY,EAAE,GAAa;IACtD,IAAI,MAAM,GAAa,EAAE,CAAC;IAE1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,EAAE,EAAE;QAC3B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;KACjB;IACD,GAAG,CAAC,IAAI,CAAC,EAAC,QAAQ,EAAE,MAAM,EAAC,CAAC,CAAC;AACjC,CAAC,CAAC,CAAC;AAEH;IAII,gBAAY,QAAgB,EAAE,SAAiB;QAC3C,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC9B,CAAC;IACL,aAAC;AAAD,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
import {Request, Response} from "express";
import express = require("express");
import bodyParser = require("body-parser");
let router = express();
router.use(bodyParser.json());
router.listen(8080, () => {
......@@ -12,13 +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: "Max", nachname: "Mahr"});
});
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[] = [];
for (let i = 1; i <= 100; i++) {
Zahlen.push(i)
}
res.json({ergebnis: Zahlen});
});
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("Max", "Mahr");
res.json(myObject);
});
class Person{
public vorname: string;
public nachname: string;
constructor(_vorname:string, _nachname: string) {
this.vorname = _vorname;
this.nachname = _nachname;
}
}
\ No newline at end of file
<h1>Max Mahr</h1>
<
\ No newline at end of file
<!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
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
......@@ -6,25 +6,24 @@ var router = express();
router.use(bodyParser.json());
router.use(bodyParser.urlencoded({ extended: true }));
router.listen(8080);
console.log("Gestartet: http://localhost:8080/raten/1");
console.log("Gestartet: http://localhost:8080/cheat/1");