Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ashhitch/ts-node-express-auth-api
Exploring using TypeScript to build a Express based API
https://github.com/ashhitch/ts-node-express-auth-api
Last synced: 7 days ago
JSON representation
Exploring using TypeScript to build a Express based API
- Host: GitHub
- URL: https://github.com/ashhitch/ts-node-express-auth-api
- Owner: ashhitch
- Created: 2018-12-21T13:19:20.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-22T09:54:59.000Z (about 2 years ago)
- Last Synced: 2024-11-10T02:45:33.532Z (2 months ago)
- Language: TypeScript
- Size: 1.05 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TypeScript Node Auth API Starter
A Basic Express API setup written in TypeScript, designed to be a starting place for any App requiring auth.
## Setup
Install: dependencies:
`yarn` or `npm install`
Run in watch mode:
`yarn watch` or `npm run watch`
Run in watch mode with node debug:
`yarn watch-debug` or `npm run watch-debug`
Copy `.env.example` to `.env`
Add DB and SMTP details ( I use [mlab](https://mlab.com/) and [mailtrap](https://mailtrap.io) )
## Current features
- Login
- Logout
- Forgotten password request
- Password reset
- Update user details
- User roles## Routes
- `/` - GET - returns welcome message
- `/admin-only` - GET - Only accessible if user has admin role
- `/register` - POST - Register a new user
- `/login` - POST - Login returns user and token
- `/account` - GET - Returns logged in user account
- `/account/forgotten` - POST - Sends password reset email
- `/account/reset` - POST - Resets users password## Roadmap
- Demo data
- Password change (for logged in user)
- Tests
- Better docs and examples## Contributions
I welcome any feedback or pull requests on this project 👍