From bc34a68b029846ed3afb7b52efa53682b5da6811 Mon Sep 17 00:00:00 2001 From: Xymorot Date: Sun, 10 Mar 2019 20:16:18 +0100 Subject: [PATCH] initial commit --- .gitignore | 5 +++++ out/index.js | 16 ++++++++++++++++ out/index.js.map | 1 + package-lock.json | 26 ++++++++++++++++++++++++++ package.json | 18 ++++++++++++++++++ src/index.ts | 17 +++++++++++++++++ tsconfig.json | 13 +++++++++++++ tslint.json | 14 ++++++++++++++ 8 files changed, 110 insertions(+) create mode 100644 .gitignore create mode 100644 out/index.js create mode 100644 out/index.js.map create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 src/index.ts create mode 100644 tsconfig.json create mode 100644 tslint.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e1f79f2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +# sensitive data +.env + +# npm +node_modules diff --git a/out/index.js b/out/index.js new file mode 100644 index 0000000..fda72f3 --- /dev/null +++ b/out/index.js @@ -0,0 +1,16 @@ +"use strict"; +exports.__esModule = true; +var dotenv = require("dotenv"); +var http = require("http"); +dotenv.config({}); +var hostname = "127.0.0.1"; +var port = 3000; +var server = http.createServer(function (req, res) { + res.statusCode = 200; + res.setHeader("Content-Type", "text/plain"); + res.end("Hello World\n"); +}); +server.listen(port, hostname, function () { + console.log("Server running at http://" + hostname + ":" + port + "/"); +}); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/out/index.js.map b/out/index.js.map new file mode 100644 index 0000000..67b8a6d --- /dev/null +++ b/out/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,+BAAiC;AACjC,2BAA6B;AAE7B,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAElB,IAAM,QAAQ,GAAG,WAAW,CAAC;AAC7B,IAAM,IAAI,GAAG,IAAI,CAAC;AAElB,IAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,UAAC,GAAG,EAAE,GAAG;IACxC,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC;IACrB,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;IAC5C,GAAG,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AAC3B,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE;IAC5B,OAAO,CAAC,GAAG,CAAC,8BAA4B,QAAQ,SAAI,IAAI,MAAG,CAAC,CAAC;AAC/D,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..7bc074f --- /dev/null +++ b/package-lock.json @@ -0,0 +1,26 @@ +{ + "name": "nhentai", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/dotenv": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@types/dotenv/-/dotenv-6.1.0.tgz", + "integrity": "sha512-gmbNb7V1LbJQA4MmH0hVFgqY1cyKsa6RvKC1Xrq0WBnZ0JuuvXKciXx/s8dN0LVXCJd8xO6wIaSFSyUIoGph9g==", + "requires": { + "@types/node": "*" + } + }, + "@types/node": { + "version": "11.11.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.0.tgz", + "integrity": "sha512-D5Rt+HXgEywr3RQJcGlZUCTCx1qVbCZpVk3/tOOA6spLNZdGm8BU+zRgdRYDoF1pO3RuXLxADzMrF903JlQXqg==" + }, + "dotenv": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-6.2.0.tgz", + "integrity": "sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w==" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..c674a1f --- /dev/null +++ b/package.json @@ -0,0 +1,18 @@ +{ + "name": "nhentai", + "version": "1.0.0", + "description": ".", + "scripts": { + "start": "node out/index.js", + "watch": "tsc --watch", + "build": "tsc --build tsconfig.json" + }, + "author": "", + "license": "ISC", + "dependencies": { + "@types/dotenv": "^6.1.0", + "@types/node": "^11.11.0", + "dotenv": "^6.2.0" + }, + "devDependencies": {} +} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..1d8fe54 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,17 @@ +import * as dotenv from "dotenv"; +import * as http from "http"; + +dotenv.config({}); + +const hostname = "127.0.0.1"; +const port = 3000; + +const server = http.createServer((req, res) => { + res.statusCode = 200; + res.setHeader("Content-Type", "text/plain"); + res.end("Hello World\n"); +}); + +server.listen(port, hostname, () => { + console.log(`Server running at http://${hostname}:${port}/`); +}); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..8d0fced --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "module": "commonjs", + "noImplicitAny": true, + "removeComments": true, + "preserveConstEnums": true, + "sourceMap": true, + "outDir": "out/" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "**/*.spec.ts"] +} diff --git a/tslint.json b/tslint.json new file mode 100644 index 0000000..2fa60b9 --- /dev/null +++ b/tslint.json @@ -0,0 +1,14 @@ +{ + "extends": "tslint:recommended", + "rules": { + "max-line-length": { + "options": [120] + }, + "new-parens": true, + "no-arg": true, + "no-bitwise": true, + "no-conditional-assignment": true, + "no-consecutive-blank-lines": true, + "no-console": false + } +} \ No newline at end of file