Simple Express JS Environment Storage Server
This simple server will allow you to create your API to store your Environment as a json file
Installing & Running
To install and run simply follow these steps:
-
Clone this repo
-
Open your terminal and run
node server.js
-
Your server is now available at
http://localhost:8080/
-
You can run a quick test by entering this in your browser:
http://localhost8080/environment
-
You can get list, save new ENV and delete the ENV :
Get list ENV: curl --location --request GET '127.0.0.1:8080/environment'
Save ENV : curl --location --request POST '127.0.0.1:8080/environment' --header 'Content-Type: application/json' --data-raw {"env":"JOB_PORT","value": "2222"}'
Edit ENV : curl --location --request PUT '127.0.0.1:8080/environment' --header 'Content-Type: application/json' --data-raw {"env":"JOB_PORT","value": "6969"}'
Run With Docker
To run with docker follow these steps:
- build the image:
docker build -f dockerfile.alpine_slim -t <docker username>/express-alpine-slim .
- run the image:
docker run -p 8080:8080 <docker username>/express-alpine-slim