Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raj-pulapakura/build-graphql-api
Build a beautiful, organised Graphql API with Typescript and Typeorm support, and pre-built examples, all with a single command!
https://github.com/raj-pulapakura/build-graphql-api
Last synced: 3 days ago
JSON representation
Build a beautiful, organised Graphql API with Typescript and Typeorm support, and pre-built examples, all with a single command!
- Host: GitHub
- URL: https://github.com/raj-pulapakura/build-graphql-api
- Owner: raj-pulapakura
- Created: 2022-01-15T08:41:39.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-16T23:58:17.000Z (almost 3 years ago)
- Last Synced: 2024-04-26T19:48:22.884Z (9 months ago)
- Language: JavaScript
- Size: 38.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# build-graphql-api
## Description
```build-graphql-api``` allows you to construct an amazing Graphql API with the following built-in features:
- Typescirpt
- Typeorm (for database connections)## Usage
Run the following command:
```
npx build-graphql-api [DIR]
```## Imporant Information
### Configuring the database
Before starting the api, go to the ```.env``` file in the root directory and enter your database credentials. You can also change the port the server will run on. ***If you do not do this, the api will crash.***
The api uses ```mysql``` be default. To change this, head over to the ```config/db.ts``` file.
### Cors
```cors``` is already taken care of, but if you need to adjust the configuration, for e.g. adding a new origin, head over to the ```src/index.ts``` file.
### Pre-built features
The api comes with 2 fully-functional features built-in: an Author model as well as a Book model. Feel free to delete these if you do not need them.
### Starting the server
Finally, to start the server, run the following command:
```
npm run dev
```The api uses ```concurrently``` to run the typescript watcher and the nodemon server at the same time.