SQLite CRUD
Node.js comes with SQLite built in. This example keeps a small movie list in an in-memory database, seeded on server start, and changes it with plain HTML forms.
Each form posts to this page, which runs a prepared statement and redirects back with 303 See Other, so reloading the page never sends a form twice. The database is shared by all visitors: reset brings back the seed data.
Movies
15 / 50| Title | Year | Rating | |
|---|---|---|---|
| Metropolis | 1927 | ★★★★★ | |
| Modern Times | 1936 | ★★★★★ | |
| Casablanca | 1942 | ★★★★★ | |
| Rashomon | 1950 | ★★★★★ | |
| Seven Samurai | 1954 | ★★★★★ | |
| Vertigo | 1958 | ★★★★★ | |
| 2001: A Space Odyssey | 1968 | ★★★★★ | |
| Alien | 1979 | ★★★★★ | |
| Blade Runner | 1982 | ★★★★★ | |
| Back to the Future | 1985 | ★★★★★ | |
| Groundhog Day | 1993 | ★★★★★ | |
| The Matrix | 1999 | ★★★★★ | |
| Spirited Away | 2001 | ★★★★★ | |
| Amélie | 2001 | ★★★★★ | |