/basic-auth-api-supabase

Primary LanguageTypeScriptMIT LicenseMIT

Basic Authentication API

this is an very basic api that handles user and admin access control already with some tests

Environment

the .env file needs to have 3 fields

Running the project

to run the project you can open your terminal and run:

  • yarn start to start directaly from typescript
  • yarn dev to watch that typescript
  • yarn build && node . (or node build/server.js)

Routes

  • [ GET ] /
    • only returns a live signal
  • [ POST ] /signup
    • create an account
  • [ POST ] /login
    • login to an account
  • [ GET ] /user-content
    • see the user content if it's logged in
  • [ GET ] /admin-content
    • see the admin content if have the permission