top 10 boilerplate ever
This commit is contained in:
commit
153c74bd22
17 changed files with 567 additions and 0 deletions
13
client/login.js
Normal file
13
client/login.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
import Route from "../route.js";
|
||||
|
||||
// TODO: rewrite
|
||||
let main = new Route([], async function (req, res, input) {
|
||||
return `<div class='form-message'></div>
|
||||
<form enctype='multipart/form-data' method='POST' action='/api/form/login'>
|
||||
Username: <input type='text' name='user'><br/>
|
||||
Password: <input type='password' name='pass'><br/>
|
||||
<input type='submit'>
|
||||
</form>`;
|
||||
});
|
||||
|
||||
export default main;
|
9
client/main.js
Normal file
9
client/main.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
import Route from "../route.js";
|
||||
import Auth from "../form/auth.js";
|
||||
import Format from "../common/format.js";
|
||||
|
||||
let main = new Route([Auth], async function (req, res, input) {
|
||||
return `Hello world! Your name is: ${Format.escape(input.username)}`
|
||||
});
|
||||
|
||||
export default main;
|
14
client/register.js
Normal file
14
client/register.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
import Route from "../route.js";
|
||||
|
||||
// TODO: rewrite
|
||||
let main = new Route([], async function (req, res, input) {
|
||||
return `<div class='form-message'></div>
|
||||
<form enctype='multipart/form-data' method='POST' action='/api/form/register'>
|
||||
Username: <input type='text' name='user'><br/>
|
||||
Password: <input type='password' name='pass'><br/>
|
||||
Password (again): <input type='password' name='pass2'><br/>
|
||||
<input type='submit'>
|
||||
</form>`;
|
||||
});
|
||||
|
||||
export default main;
|
Loading…
Add table
Add a link
Reference in a new issue