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! ๐