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":"server.js","sourceRoot":"","sources":["server.ts"],"names":[],"mappings":";;AACA,iCAAoC;AACpC,wCAA2C;A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AAE,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{
class Person {
public vorname: string;
public nachname: string;
constructor(_vorname:string, _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);
});
<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>