The Feminist API is a RESTful API implementation that provides access to randomly generated feminist quotes.
This idea was originally proposed by Patricia Parra. Thanks for the inspiration!
- Tech stack
- How to run
- How to develop
- How to use the CLI
- Install the program
- API declaration
- Contribute
- License
- ANSI C
- Docker
- GNU Make
- Mongoose web server
- OpenSSL
If you want to try out the application you can run the server as a docker container. This step assumes that you have Docker installed.
Simply pull the image from our Docker Hub registry:
# Create a docker container with the application `feminist_api`
docker run -p 8080:8000 -d --name feminist_api vcwild/feminist_api:latest
# Open the application in your browser
xdg-open http://localhost:8080
If you want to know how to use the CLI tool, you can check this topic.
If you feel like it, you can build the container yourself:
docker build . -t vcwild/feminist_api:latest
Now you can run the container, as previosly mentioned.
Please, follow the instructions below only if you intend to develop for this application.
The current instance of the Feminist API project is only supported on Linux distributions.
In order to compile and run the server, it is strongly recommended to get at least a build-essential or equivalent package module, although it might not be required, depending on your system.
In order to install the build essentials, run the following command:
sudo apt-get install build-essential
The Fedora/RHEL/CentOS equivalent to the above is:
sudo yum install make automake gcc gcc-c++ kernel-devel
Other distributions may require different libraries, please check the documentation of your package manager.
Follow along these steps:
-
Clone this repository
-
Test the server execution with
make run
. -
Go to the root of your git clone
-
Run
make
to build the server -
IMPORTANT: temporarily update your path to include the current program build.
export PATH=$PATH:$(pwd)
- Now run the program by executing the
feminist_api
command.
This command will bind your terminal to the server and wait for requests.
You can also run this as a background process:
feminist_api &
In this case, you can end the process with the following command:
kill $(pgrep feminist_api)
This application also supports HTTPS via SSL and TLS.
You will need to install TLS libraries for your distribution:
sudo apt-get install libssl-dev libmbedtls-dev
sudo yum install openssl-devel mbedtls-devel
Other distributions may require different libraries, please check the documentation of your package manager.
After the installation, you can compile the dependencies and run the server as previosly mentioned here, but with the caveat that you need to add the TLS libraries to your execution:
make MBEDTLS_DIR=/your/path/to/mbedtls
The server logs can be accessed via the ada
command line interface. This step assumes that the server is already running.
This step assumes that you already have the server running in a docker container.
Execute ada
commands through the docker interface:
docker exec -it feminist_api ada --help
You can also make an alias for that, to make this process easier:
alias ada="docker exec -it feminist_api ada"
Now you can run the CLI as if you were running it from your own terminal:
ada --help
This step assumes that you followed the how to develop guide.
Update your path with the current directory if you don't have it already:
export PATH=$PATH:$(pwd)
Simply execute any CLI interaction by using the ada
command.
# e.g. get help from the CLI
ada --help
- It is also possible to install the program with
make install
. This will add thefeminist_api
server and theada
CLI to the/usr/local/bin
directory permanently.
Enjoyed the application? Please, consider contributing to the project.
This project is under the GNU General Public License v3.