-
To use the backend, start by cloning the code to your local computer:
git clone https://github.com/sonnerberg/jsramverk-editor-backend
-
Change into the newly created directory:
cd jsramverk-editor-backend
-
Install all the dependencies:
npm run reinstall
-
Make a copy of the
.env
-example file:cp .env.example .env
-
Edit the .env file to suit your needs.
code .env
or:
vim .env
or:
nano .env
-
Start the server (this will use a local database):
npm run develop
If you want to use Mongo DB Atlas, instead run:
npm start
You can import a json file into Postman to test all the routes of the api.
The routes are structures in the following way:
POST /api/v1/create
: Create a new document using a body containingname
andhtml
.PUT /api/v1/update
: Update an existing document using a body containing_id
,name
, andhtml
.GET /api/v1/
: Get a list of all documents with their_id
,name
, andhtml
.GET /api/v1/:id
: Get a single document where:id
is a valid document_id
.
The backend is deployed here: Azure
The frontend is deployed here: Bleking Tekniska Högskola