#todo #handlebars #warp #reqwest #web-server #client #reqwest-client

bin+lib todo_web_server

A Todo-web-server for learning purpose

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

#480 in HTTP client

21 downloads per month

MIT license

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

  1. To learn Rust, web application in particular.
  2. To fetch data from todo app server using Reqwest framework.
  3. To try out with Handlebars (as TERA was already tried out with other web app)
  4. To make use of it as template for future projects.

How to use it

  1. Clone or download this app from github.
  2. Edit Settings.toml file to update ip address, app server's ip address, log folder name.
  3. Build an executable file using $cargo build --release
  4. 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
  5. Edit todo_web.service for folder names and follow instructions in it, to run this app as a service in linux.
  6. 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
  7. A home page appears; click on View All Todos, to see list of Todos.
  8. 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

~60MB
~1M SLoC