Git Product home page Git Product logo

envapi's Introduction

Project README ๐Ÿคฉ

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 ๐Ÿ”’

Getting started ๐Ÿ

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 ๐Ÿš€

API endpoints ๐Ÿšช

The following API endpoints are available:

GET /env/:projectName

Retrieves the environment variables for the specified project name ๐ŸŒณ

Parameters

projectName (required): the name of the project for which to retrieve environment variables ๐Ÿ“

Headers

Authorization: the authentication token, in the format Bearer {AUTH_TOKEN} ๐Ÿ”’

Response

  • 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 ๐Ÿคท

GET *

Returns a 404 "Not Found" error for all other API requests ๐Ÿค”

Dependencies ๐Ÿ“ฆ

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 ๐Ÿ’พ

License ๐Ÿ“œ

This project is licensed under the MIT license ๐Ÿค So, you can use it freely! ๐Ÿ’ƒ

envapi's People

Contributors

ertugrul013 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.