An api template showing how an API works. Uses express. Please look below for the steps to set this up.
- Go to config.js
- Edit the
port
with the port you want to run the API on.
- After you're done with editing the config, save the file and run
npm i
in your terminal. - This'll install all the packages the API uses.
- Start the API with
node server.js
. If you're locally hosting the API, go tolocalhost:your_port_here
on your browser to access it.
Type of Request | Endpoints | Required Paramters | Description |
---|---|---|---|
GET | /quote |
none | Displays a random quote along with its author. |
GET | /joke |
none | Displays a random joke. |
GET | /base64 |
type, text | Encodes and decodes text to and from base64. |