Welcome to my awesome Express.js API project! π This project retrieves environment variables for a given project name, all while keeping it secure with a secret authentication token π
To get started with the project, you will need to have Node.js and npm installed on your system. You will also need to create a database and set up the necessary environment variables π³
- Clone the project repository to your local machine π₯οΈ
- Install dependencies by running npm install π»
- Set up the necessary environment variables by creating a .env file in the project root directory π€« The following variables are required:
- DATABASE_URL: the connection string for your database π
- AUTH_TOKEN: a static authentication token to be used for API requests π
- Run the migration scripts to set up the database tables by running npx prisma migrate dev in the terminal π»
- Start the server by running npm start π
The following API endpoints are available:
Retrieves the environment variables for the specified project name π³
projectName (required): the name of the project for which to retrieve environment variables π
Authorization: the authentication token, in the format Bearer {AUTH_TOKEN} π
- 200 OK: returns an objec t containing the environment variables for the specified project π
- 401 Unauthorized: if the authentication token is missing or invalid π‘
- 404 Not Found: if no environment variables are found for the specified project π€·
Returns a 404 "Not Found" error for all other API requests π€
This project uses the following dependencies:
- express: web framework for Node.js π
- dotenv: loads environment variables from a .env file π
- @prisma/client: ORM for interacting with the database πΎ
This project is licensed under the MIT license π€ So, you can use it freely! π