Skip to content

sonnerberg/jsramverk-editor-backend

Repository files navigation

Backend for the course jsramverk

codecov Build Status Coverage Status

  1. To use the backend, start by cloning the code to your local computer:

    git clone https://github.com/sonnerberg/jsramverk-editor-backend
  2. Change into the newly created directory:

    cd jsramverk-editor-backend
  3. Install all the dependencies:

    npm run reinstall
  4. Make a copy of the .env-example file:

    cp .env.example .env
  5. Edit the .env file to suit your needs.

    code .env

    or:

    vim .env

    or:

    nano .env
  6. 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 containing name and html.
  • PUT /api/v1/update: Update an existing document using a body containing _id, name, and html.
  • GET /api/v1/: Get a list of all documents with their _id, name, and html.
  • 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published