Skip to content

Repo for golang practice courser, site for searching comics in xkcd.com

License

Notifications You must be signed in to change notification settings

vacmannnn/xkcd-searcher

Repository files navigation

xkcd searcher

A tool to search comics from xkcd.

xkcd.mp4

Usage

  1. Download project:
git clone [email protected]:vacmannnn/xkcd-searcher.git && cd xkcd-searcher
  1. Build and run it:
make
make run
  1. Go to localhost:3000 to use search (default login and password is user;user)

If you want to run separate scenarios you may use:

  • make xkcd to build xkcd-server
  • make web to build web-server
  • make test to run all tests
  • make lint/sec to run utility checks on project (to run make sec you need to build xkcd-server first)

web-server

Web-server connects with xkcd-server to use it as comics finder and authorization service.

Default source url is localhost:3000/login

xkcd-server

By default, it listens localhost:8080. To use xkcd-server you may use rest API:

Getting JWT:

curl -d '{"username":"admin", "password":"admin"}' "http://localhost:8080/login"

Update and search requests:

curl -X POST --header "Authorization:TOKENFROMPREVIOUSSTEP" "http://localhost:8080/update"
curl -X GET --header "Authorization:TOKENFROMPREVIOUSSTEP" "http://localhost:8080/pics?search='apple,doctor'"

About

Repo for golang practice courser, site for searching comics in xkcd.com

Topics

Resources

License

Stars

Watchers

Forks