5 releases
0.1.4 | Jul 2, 2020 |
---|---|
0.1.3 | Jul 2, 2020 |
0.1.2 | Mar 11, 2020 |
0.1.1 | Mar 9, 2020 |
0.1.0 | Mar 9, 2020 |
#9 in #reqwest-client
27KB
353 lines
todo_web_server
Note: todo web server is written based on Warp's example at Todo; here, web pages are rendered to access todo data from its app-server.
It renders web pages to access/add/modify/delete todo application data; uses handlebars templates, makes use of Reqwest client framework, and runs as a web server using WARP server framework. No database activities are handled here.
dependency
A running todo_app_server is required that supports RESTFul API calls such as GET, POST, PUT, DELETE.
Goals
- To learn Rust, web application in particular.
- To fetch data from todo app server using Reqwest framework.
- To try out with Handlebars (as TERA was already tried out with other web app)
- To make use of it as template for future projects.
How to use it
- Clone or download this app from github.
- Edit Settings.toml file to update ip address, app server's ip address, log folder name.
- Build an executable file using $cargo build --release
- Copy following files/folder into a separate folder, say "~/projects":
a. target/release/todo-web file
b. Settings.toml file
c. templates folder
d. todo_web.service file - Edit todo_web.service for folder names and follow instructions in it, to run this app as a service in linux.
- Assuming an entry in Settings.toml file for ip_address as 127.0.0.1:3040 and todo_app_server running at 127.0.0.1:3030, open up a web browser and enter url as http:://127.0.0.1:3040
- A home page appears; click on View All Todos, to see list of Todos.
- First time visit to Todos, may not have a list to show. Try with Add link; it brings up Add Todo page; try to fill-in and submit; now the added todo is listed; try to edit and then try to delete. In case of any problem in 'Delete' option with Chrome browser, try with Firefox browser.
Demo
A demo application is running at the following address:
Todo-Web Demo
License
MIT
Dependencies
~62MB
~1M SLoC