Setup Aufgabe 08

This commit is contained in:
Justin Dretvic 2020-06-17 10:25:27 +02:00
parent be14c6f446
commit 1cd9fef28e
15 changed files with 188 additions and 8 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
node_modules/
package-lock.json

Binary file not shown.

View File

@ -1,6 +0,0 @@
{
"ExpandedNodes": [
""
],
"PreviewInSolutionExplorer": false
}

Binary file not shown.

15
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}

View File

@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.A08Server = void 0;
const Http = require("http");
var A08Server;
(function (A08Server) {
console.log("Starting server");
let port = Number(process.env.PORT);
if (!port)
port = 8100;
let server = Http.createServer();
server.addListener("request", handleRequest);
server.addListener("listening", handleListen);
server.listen(port);
function handleListen() {
console.log("Listening");
}
function handleRequest(_request, _response) {
console.log("I hear voices!");
_response.setHeader("content-type", "text/html; charset=utf-8");
_response.setHeader("Access-Control-Allow-Origin", "*");
_response.write(_request.url);
_response.end();
}
})(A08Server = exports.A08Server || (exports.A08Server = {}));
//# sourceMappingURL=test.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"test.js","sourceRoot":"","sources":["test.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAE7B,IAAiB,SAAS,CAyBzB;AAzBD,WAAiB,SAAS;IACtB,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAC/B,IAAI,IAAI,GAAW,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC5C,IAAI,CAAC,IAAI;QACL,IAAI,GAAG,IAAI,CAAC;IAEhB,IAAI,MAAM,GAAgB,IAAI,CAAC,YAAY,EAAE,CAAC;IAC9C,MAAM,CAAC,WAAW,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAC7C,MAAM,CAAC,WAAW,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;IAC9C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAEpB,SAAS,YAAY;QACjB,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC7B,CAAC;IAED,SAAS,aAAa,CAAC,QAA8B,EAAE,SAA8B;QACjF,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAE9B,SAAS,CAAC,SAAS,CAAC,cAAc,EAAE,0BAA0B,CAAC,CAAC;QAChE,SAAS,CAAC,SAAS,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;QAExD,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAE9B,SAAS,CAAC,GAAG,EAAE,CAAC;IACpB,CAAC;AACL,CAAC,EAzBgB,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAyBzB"}

View File

@ -0,0 +1,28 @@
import * as Http from "http";
export namespace A08Server {
console.log("Starting server");
let port: number = Number(process.env.PORT);
if (!port)
port = 8100;
let server: Http.Server = Http.createServer();
server.addListener("request", handleRequest);
server.addListener("listening", handleListen);
server.listen(port);
function handleListen(): void {
console.log("Listening");
}
function handleRequest(_request: Http.IncomingMessage, _response: Http.ServerResponse): void {
console.log("I hear voices!");
_response.setHeader("content-type", "text/html; charset=utf-8");
_response.setHeader("Access-Control-Allow-Origin", "*");
_response.write(_request.url);
_response.end();
}
}

View File

View File

@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="tutorial.js" defer></script>
<title>Tutorial Kapitel 08</title>
</head>
<body>
<form action="">
<label for="vorname">Vorname:</label> <br>
<input type="text" id="vorname" name="vorname" value="Ben"> <br>
<label for="nachname">Nachname:</label> <br>
<input type="text" id="nachname" name="nachname" value="Uchiha"> <br>
<input type="submit" value="Submit Input">
<button type="submit">Submit Button</button>
</form>
<hr>
<form method="get" action="">
<button type="submit">Get</button>
</form>
<form method="get" action="https://gis-example.herokuapp.com/">
<button type="submit">Get mit URL in Action</button>
</form>
<hr>
<form method="post" action="">
<button type="submit">Post</button>
</form>
<form method="post" action="https://gis-example.herokuapp.com/">
<button type="submit">Post mit URL in Action</button>
</form>
</body>
</html>
<style>
button,label,input {
margin: 10px;
}
</style>

View File

@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.tutorial08 = void 0;
var tutorial08;
(function (tutorial08) {
let formData = new FormData(document.forms[0]);
console.log(formData.get("vorname"));
for (let entry of formData) {
console.log(entry);
console.log("name: " + entry[0]);
console.log("value: " + entry[1]);
}
// Trennlinie
let url = "https://WeOwnTheWorld.server/path/file";
let query = new URLSearchParams(formData);
url += url + "?" + query.toString();
// await fetch(url);
})(tutorial08 = exports.tutorial08 || (exports.tutorial08 = {}));
//# sourceMappingURL=tutorial.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"tutorial.js","sourceRoot":"","sources":["tutorial.ts"],"names":[],"mappings":";;;AAIA,IAAiB,UAAU,CAmB1B;AAnBD,WAAiB,UAAU;IAE3B,IAAI,QAAQ,GAAa,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAEzD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;IAErC,KAAK,IAAI,KAAK,IAAI,QAAQ,EAAE;QACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACnB,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACjC,OAAO,CAAC,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KACrC;IAED,aAAa;IAEb,IAAI,GAAG,GAAW,wCAAwC,CAAC;IAC3D,IAAI,KAAK,GAAoB,IAAI,eAAe,CAAM,QAAQ,CAAC,CAAC;IAChE,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;IACpC,oBAAoB;AAEpB,CAAC,EAnBgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAmB1B"}

View File

@ -0,0 +1,24 @@
import * as HTTp from "http";
import * as Url from "url";
export namespace tutorial08 {
let formData: FormData = new FormData(document.forms[0]);
console.log(formData.get("vorname"));
for (let entry of formData) {
console.log(entry);
console.log("name: " + entry[0]);
console.log("value: " + entry[1]);
}
// Trennlinie
let url: string = "https://WeOwnTheWorld.server/path/file";
let query: URLSearchParams = new URLSearchParams(<any>formData);
url += url + "?" + query.toString();
// await fetch(url);
}

View File

@ -13,8 +13,9 @@ body {
</head> </head>
<body> <body>
<!-- Hier die Links zu den gelösten Aufgaben einstellen, aktuelle oben, alte stehen lassen! Format: Aufgabenbezeichnung, Datum --> <!-- Hier die Links zu den gelösten Aufgaben einstellen, aktuelle oben, alte stehen lassen! Format: Aufgabenbezeichnung, Datum -->
<a href="https://github.com/YamiDesu/GIS-SoSe-2020/issues" target="_blank"> Github Reposiroty → Issues <br> </a> <a href="https://github.com/YamiDesu/GIS-SoSe-2020/issues" target="_blank"> Github Reposiroty → Issues <br> </a>
<a href="https://yamidesu.github.io/GIS-SoSe-2020/Aufgaben/Aufgabe_07_2020-06-10/shop.html" target="_blank"> Aufgabe_07_2020-06-10 <br> </a> <a href="https://yamidesu.github.io/GIS-SoSe-2020/Aufgaben/Aufgabe_08_2020-06-17/?" target="_blank"> Aufgabe_08_2020-06-17 <br> </a>
<a href="https://yamidesu.github.io/GIS-SoSe-2020/Aufgaben/Aufgabe_07_2020-06-10/shop.html" target="_blank"> Aufgabe_07_2020-06-10 <br> </a>
<a href="https://yamidesu.github.io/GIS-SoSe-2020/Aufgaben/Aufgabe_06_2020-06-03/shop.html" target="_blank"> Aufgabe_06_2020-06-03 <br> </a> <a href="https://yamidesu.github.io/GIS-SoSe-2020/Aufgaben/Aufgabe_06_2020-06-03/shop.html" target="_blank"> Aufgabe_06_2020-06-03 <br> </a>
<a href="https://yamidesu.github.io/GIS-SoSe-2020/Aufgaben/Aufgabe_05_2020-05-27/shop.html" target="_blank"> Aufgabe_05_2020-05-27 <br> </a> <a href="https://yamidesu.github.io/GIS-SoSe-2020/Aufgaben/Aufgabe_05_2020-05-27/shop.html" target="_blank"> Aufgabe_05_2020-05-27 <br> </a>
<a href="https://yamidesu.github.io/GIS-SoSe-2020/Aufgaben/Aufgabe_04_2020-05-20/shop.html" target="_blank"> Aufgabe_04_2020-05-20 <br> </a> <a href="https://yamidesu.github.io/GIS-SoSe-2020/Aufgaben/Aufgabe_04_2020-05-20/shop.html" target="_blank"> Aufgabe_04_2020-05-20 <br> </a>

21
package.json Normal file
View File

@ -0,0 +1,21 @@
{
"name": "thetwoandonlygis",
"version": "1.0.0",
"description": "Diese Datei soll mir helfen, mit Heruko arbeiten zu können.",
"main": "index.js",
"dependencies": {},
"devDependencies": {},
"scripts": {
"start": "node Aufgaben/Aufgabe_08_2020-06-17/test.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/YamiDesu/GIS-SoSe-2020.git"
},
"author": "Justin Dretvic",
"license": "ISC",
"bugs": {
"url": "https://github.com/YamiDesu/GIS-SoSe-2020/issues"
},
"homepage": "https://github.com/YamiDesu/GIS-SoSe-2020#readme"
}