davidad / c_web_app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Interviewer: "What language are you most comfortable with?"
davidad: "C."
Interviewer: "Oh. We usually have people make a web app, so..."
davidad: "No problem. I'm prepared for this."

c_web_app

Requirements

  • nginx: I follow these instructions to get a local build of nginx from the OpenResty distribution, but your package manager's nginx binary should be just fine for our purposes here
  • redis: usually [package-manager] install redis
  • hiredis: usually [package-manager] install hiredis; make sure that the libs are actually available (I did sudo ln -sf /usr/local/opt/hiredis/lib/* /usr/lib and sudo ln -sf /usr/local/opt/hiredis/include/* /usr/include)

###Makefile targets

$ make run          # runs the app, compiling it and spinning up redis and nginx if necessary
$ make nginx.pid    # spins up nginx
$ make redis.pid    # spins up redis
$ make kill-nginx   # shuts down nginx
$ make kill-redis   # shuts down redis
$ make resetdb      # deletes the redis.rdb database, shutting down redis first if necessary
$ make clean        # shut down everything, remove binary and log files. run before `git commit`

About


Languages

Language:C 73.3%Language:C++ 26.7%