Giter Site home page Giter Site logo

ikt-pwa-backend-01's Introduction

Backend für HTW_Insta

REST-API für Posts.

POST = { title: String, location: String, image_id: String }

  • GET /posts
  • GET /posts/:id
  • POST /posts
  • DELETE /posts/:id

Verbindung zur Datenbank

MongoDB (Cloud Atlas)

  1. .env-Datei erstellen. Beispiel:

    DB_CONNECTION = mongodb+srv://ikt-pwa.0elr1ih.mongodb.net/?authSource=%24external&authMechanism=MONGODB-X509&retryWrites=true&w=majority DATABASE = htwinsta PATH_TO_PEM = assets/X509-cert-3298914405631471913.pem PORT = 3000

  2. Wenn Zertifikat, dann Zertifikat in den assets-Ordner kopieren.

  3. Wenn kein Zertifikat, können überall die credentials gelöscht werden und die jeweiligen option-Blöcke in den `mongoose-Connection. Z.B. wird aus

    const credentials = process.env.PATH_TO_PEM

    const connection = mongoose.createConnection(process.env.DB_CONNECTION, { sslKey: credentials, sslCert: credentials, dbName: "htwinsta" });

einfach

const connection = mongoose.createConnection(process.env.DB_CONNECTION);

Starten

npm i npm run watch

ikt-pwa-backend-01's People

Contributors

jfreiheit2013 avatar

Watchers

Jörn Freiheit avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.