Compare commits
2 commits
a7f07853ee
...
ab3cc0c217
| Author | SHA1 | Date | |
|---|---|---|---|
| ab3cc0c217 | |||
| dbbc8c63b8 |
2 changed files with 29 additions and 7 deletions
13
module.nix
13
module.nix
|
|
@ -6,13 +6,7 @@
|
||||||
virtualHosts.localhost.locations."/" = {
|
virtualHosts.localhost.locations."/" = {
|
||||||
index = "index.html";
|
index = "index.html";
|
||||||
|
|
||||||
root = pkgs.writeTextDir "index.html" ''
|
root = "/var/www";
|
||||||
<html>
|
|
||||||
<body>
|
|
||||||
Hello World!
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -25,5 +19,10 @@
|
||||||
host.port = 8080;
|
host.port = 8080;
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
virtualisation.sharedDirectories.www = {
|
||||||
|
source = "$WWW";
|
||||||
|
target = "/var/www";
|
||||||
|
};
|
||||||
|
|
||||||
system.stateVersion = "23.11";
|
system.stateVersion = "23.11";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
23
www/index.html
Normal file
23
www/index.html
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<button id='add'>+</button>
|
||||||
|
</body>
|
||||||
|
<script>
|
||||||
|
let add = document.getElementById('add');
|
||||||
|
function newTask() {
|
||||||
|
let subtract = document.createElement('button');
|
||||||
|
subtract.textContent = "-";
|
||||||
|
let input = document.createElement('input');
|
||||||
|
input.setAttribute('type', 'text');
|
||||||
|
let div = document.createElement('div');
|
||||||
|
div.replaceChildren(subtract, input);
|
||||||
|
function remove() {
|
||||||
|
div.replaceChildren();
|
||||||
|
div.remove();
|
||||||
|
}
|
||||||
|
subtract.addEventListener('click', remove);
|
||||||
|
add.before(div);
|
||||||
|
}
|
||||||
|
add.addEventListener('click', newTask);
|
||||||
|
</script>
|
||||||
|
</html>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue