-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ourchitecture <[email protected]>
- Loading branch information
1 parent
dc039ec
commit b6aa039
Showing
13 changed files
with
209 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
**/.task-output | ||
**/.wireit | ||
**/node_modules | ||
**/test-results/ | ||
**/playwright-report/ | ||
**/playwright/.cache/ | ||
**/test-results | ||
**/playwright-report | ||
**/playwright/.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+22.7 KB
src/experiments/todo/implementations/html-and-expressjs/empty-todo-error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 29 additions & 1 deletion
30
src/experiments/todo/implementations/html-and-expressjs/public/stylesheets/style.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,40 @@ | ||
body { | ||
padding: 50px; | ||
margin: auto; | ||
padding: 1em; | ||
font: | ||
14px 'Lucida Grande', | ||
Helvetica, | ||
Arial, | ||
sans-serif; | ||
} | ||
|
||
h1 { | ||
font-size: 2em; | ||
font-weight: bold; | ||
} | ||
|
||
main { | ||
padding: 2em; | ||
} | ||
|
||
a { | ||
color: #00b7ff; | ||
} | ||
|
||
ul { | ||
list-style: circle; | ||
} | ||
|
||
li { | ||
margin-left: 1.5em; | ||
} | ||
|
||
#error { | ||
margin: 1em; | ||
color: red; | ||
font-style: italic; | ||
} | ||
|
||
input[name='new-todo'] { | ||
margin-left: 0.5em; | ||
} |
36 changes: 36 additions & 0 deletions
36
src/experiments/todo/implementations/html-and-expressjs/routes/createTodo.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
var express = require('express') | ||
var uid = require('uid-safe') | ||
|
||
var router = express.Router() | ||
|
||
router.post('/', function (req, res, next) { | ||
if (!req.session.todos) { | ||
req.session.todos = [] | ||
} | ||
|
||
const newTodoText = req.body['new-todo'] | ||
|
||
if (!newTodoText) { | ||
res.redirect( | ||
'/?e=' + encodeURIComponent('Missing new-todo field value') | ||
) | ||
return | ||
} | ||
|
||
if (newTodoText.trim().length === 0) { | ||
res.redirect( | ||
'/?e=' + | ||
encodeURIComponent('Empty or whitespace new-todo field value') | ||
) | ||
return | ||
} | ||
|
||
req.session.todos.push({ | ||
id: uid.sync(18), | ||
text: req.body['new-todo'], | ||
}) | ||
|
||
res.redirect('/') | ||
}) | ||
|
||
module.exports = router |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
src/experiments/todo/implementations/html-and-expressjs/routes/users.js
This file was deleted.
Oops, something went wrong.
124 changes: 118 additions & 6 deletions
124
src/experiments/todo/implementations/html-and-expressjs/tests/todos.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters