Skip to content

REST API example for grapesjs and grapesjs-template-manager

License

Notifications You must be signed in to change notification settings

Ju99ernaut/gjs-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Super FastAPI

A REST API boilerplate project using fastapi and dataset, setup for easy deployment on heroku.

Deploy

Usage

Clone the repo

$ git clone https://github.com/Ju99ernaut/gjs-api.git
$ cd superfast-api

Create virtual enviroment

$ python -m venv venv

Activate virtual enviroment

Linux/MacOS: source venv/bin/activate Windows: .\venv\Scripts\Activate.ps1 or .\venv\Scripts\activate

Install dependencies

$ pip install -r requirements.txt`

Run

$ python api/main.py

The API should now be available at http://127.0.0.1:8000 and the API documentation will be available at /docs or /redoc.

Depending on the type of database backend, you may also need to install a database specific driver package. For MySQL, this is MySQLdb, for Postgres its psycopg2. SQLite support is integrated into Python.

On heroku you may come across the sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:postgres, you can avoid it by replacing postgres://... with postgresql://... in your connection url, or you can handle for it programmatically using something like:

url = url.replace("postgres:", "postgresql:")

License

MIT

About

REST API example for grapesjs and grapesjs-template-manager

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages