Git Product home page Git Product logo

fyptest's Introduction

Environment File Sample

./src/.env.local

PORT=3000
DATABASE_URL=mysql://admin:pass123@localhost:3306/test_database
ACCESS_TOKEN_SECRET=d3552a52da30fb20d7f24b4c89a3a598c15f3e28c603baa2ab8e20b88df043fa6cbcdd1cfbaa881f8ac6e4a2d7b54fc087124c696de87acbc8b9992407122b07
REFRESH_TOKEN_SECRET=cfffb8361c2b06934ef2fe0954ccb4300ba2aabb8424ceb2f104e29043461abaabe841e2665c531215b7f73104ac49e698ef6fce568e0912d15e1ebce8f41f1f
SESSION_SECRET=9c839d3037eee9acce623eb3d22c61f8444bf74fdefa3fd09fcbab4170ef64b9c9c143e5f5bce2e51663e2deab746eb791bf01fad07ee6058efec09e71c4a50e

Environment Variables

Create .env.local inside the directory /src

PORT

Run your app on a certain port (integer). Example:

PORT=3000

DATABASE_URL

MySQL Database url (String)

mysql://<user>:<password>@<host>:<port>/<database>

Example:

DATABASE_URL=mysql://admin:pass123@localhost:3306/test_database

ACCESS_TOKEN_SECRET, REFRESH_TOKEN_SECRET

Access token and refresh token secret for JWT authentication.

Recommended way

First open the terminal and enter node to enter interactive mode of node

Enter the following command to generate random 64 bytes hex for both token secrets

require('crypto').randomBytes(64).toString('hex')

Copy the 64 bytes hex code and use it as the token secrets

Example:

ACCESS_TOKEN_SECRET=d3552a52da30fb20d7f24b4c89a3a598c15f3e28c603baa2ab8e20b88df043fa6cbcdd1cfbaa881f8ac6e4a2d7b54fc087124c696de87acbc8b9992407122b07
REFRESH_TOKEN_SECRET=cfffb8361c2b06934ef2fe0954ccb4300ba2aabb8424ceb2f104e29043461abaabe841e2665c531215b7f73104ac49e698ef6fce568e0912d15e1ebce8f41f1f

SESSION_SECRET

Session Secret to encrypt and handle session.

Recommended way

Secret key can be generated from the crypto library as shown in the ACCESS_TOKEN_SECRET, REFRESH_TOKEN_SECRET section.

Example:

SESSION_SECRET=9c839d3037eee9acce623eb3d22c61f8444bf74fdefa3fd09fcbab4170ef64b9c9c143e5f5bce2e51663e2deab746eb791bf01fad07ee6058efec09e71c4a50e

fyptest's People

Contributors

thebluedragon7 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.