This commit is contained in:
selcuk committed 2022-06-28 19:11:21 +03:00
1 parent 5e347ba806
commit e42849dc1b
22 files changed
+4459 -89

No files matched your search

BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
+16 -9
View File
@@ -1,14 +1,21 @@
const http = require("http");
const express = require("express");
const path = require("path");
const hostname = "127.0.0.1";
const port = 3000;
// Init App
const app = express();
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader("Content-Type", "text/plain");
res.end("Hello Worldyy bro");
// Static Files
app.use(express.static("public"));
app.use("/css", express.static(__dirname + "public/css "));
app.use("/js", express.static(__dirname + "public/js "));
app.use("/img", express.static(__dirname + "public/img "));
// Home Route
app.get("/", function (req, res) {
res.sendFile(__dirname + "/views/index.html");
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
// Start Server
app.listen(3000, function () {
console.log("Server started on port 3000...");
});
+2037 -78
View File
File diff suppressed because it is too large. Load diff
+7 -2
View File
@@ -4,12 +4,17 @@
"description": "",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "./node_modules/.bin/nodemon npm index.js"
"dev": "nodemon npm index.js",
"start": "node index.js"
},
"author": "Selcuk Sari",
"license": "ISC",
"dependencies": {
"express": "^4.18.1",
"pug": "^3.0.2",
"xterm": "^4.18.0"
},
"devDependencies": {
"nodemon": "^2.0.18"
}
}
+13
View File
@@ -0,0 +1,13 @@
// import { Terminal } from "xterm";
import { Terminal } from "/run/media/selcuk/Linux/repo/Anka_Anvil/Rev1/node/node_modules/xterm/lib/xterm.js";
const terminal = document.getElementById("terminal");
console.log("hi");
const term = Terminal({ cols: 120, rows: 40 });
// const term = new Terminal();
// term.open(terminalDiv);
// term.write("first succesfull hello world");
terminal.innerHTML = "Terminal should be here";
+14
View File
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Anka Anvil</title>
</head>
<body>
HEllo2
<div id="terminal"></div>
<script src="js/ss.js" type="module"></script>
</body>
</html>
+21
View File
@@ -0,0 +1,21 @@
doctype html
html
head
title Anka Anvil
body
h1 #{title}
h2 asdasd
h2#terminal
h1= title
div= foo
div
label Bar
input(
type='text'
name='city'
placeholder='start typing...'
)
input(type='submit' id='submitbtn' value='Submit')
script.
document.addEventListener('keydown', event => {console.log("Bleep!")})
document.getElementById('submitbtn').addEventListener('click', () => doSomething())