https://github.com/9andresc/world-texting-foundation
A simple Node.js server that provides an API for WTF (World Texting Foundation)
https://github.com/9andresc/world-texting-foundation
Last synced: 3 months ago
JSON representation
A simple Node.js server that provides an API for WTF (World Texting Foundation)
- Host: GitHub
- URL: https://github.com/9andresc/world-texting-foundation
- Owner: 9andresc
- Created: 2020-10-27T01:30:46.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-11-08T11:41:11.000Z (over 4 years ago)
- Last Synced: 2025-02-04T16:50:20.402Z (4 months ago)
- Language: TypeScript
- Size: 578 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# World Texting Foundation API
A simple Node.js server that provides an API for WTF (World Texting Foundation)# Installation
1. Install dependencies
```bash
$ npm i
```
2. Run DB migrations
```bash
$ npm run dbm:run
```
3. Run DB seeds
```bash
$ npm run dbs:run
```
4. Create .env file in root with this content
```
JWT_SECRET=
PORT=3000
```
5. Run script to generate JWT secret
```bash
$ npm run spt:secret
```
6. Fill `JWT_SECRET` value
```
JWT_SECRET=
PORT=3000
```# Usage
- To start the API server run
```bash
$ npm start
```
- To run the test suite
```bash
$ npm test
```
- There's a Postman collection ready to be imported inside `/src/docs`
- If you want to use the guarded endpoints `PUT` and `DELETE` /acronym/:acronym, generate a token running
```bash
$ npm run spt:token
```# Acknowledgments
- Document API using Swagger to have a more universal way to test the endpoints
- Use Docker to containerize API, and maybe even use a more robust database like PostgreSQL in conjunction