#comments #warp #utility #tool #back-end

bin+lib comment_app_backend

Serves comments through Restful APIs

4 releases

0.1.3 Jul 7, 2020
0.1.2 Jul 7, 2020
0.1.1 Jun 8, 2020
0.1.0 Jun 6, 2020

#1217 in HTTP server

MIT license

79KB
2K SLoC

Comment App Backend

It provides basic activities such as add, update, delete on comments and replies; stores them into SQLite database.

Goals

  1. To learn Rust language.
  2. To make a re-usable module / app / library.
  3. To support Anonymous users and Logged-In users
    • Anonymous users cannot modify or delete comment once submitted;
    • whereas, Logged-In users can modify or delete it.

How to use it

  1. Clone or download this app.
  2. Edit Settings.toml file to update names of database folder, log folder, ip address, ...
  3. Build an executable file using $cargo build --release.
  4. Copy following files/folder into a separate folder, say "~/projects":
    a. target/release/comment-app-backend file
    b. Settings.toml file
    c. images folder
    d. comment_app_backend.service file
  5. Edit comment_app_backend.service for folder names; follow instructions in it, to run this app as a service in linux.
  6. Assuming entry in Settings.toml file for ip_address as 127.0.0.1:6050, open up a web browser and enter url as http:://127.0.0.1:6050/comments. Browser shows comments in JSON format. It confirms server is running.
    • for other possible url paths, refer functions in src/filters.rs source code file. Each function at the start is shown with url path.
    • this backend server can be accessed using
      a. Postman
      b. frontend server
      - for frontend server, install Comment_App_Frontend.

Demo

Click here to view demo.

License

MIT

Dependencies

~57MB
~1M SLoC