# Setup von hubble mit der hubble Data API als Backend Proxy
Für die Verwendung der hubble Data API als Proxy für ein Backend der Wahl sind folgende Schritte notwendig:
# Requirements
- Node.js (opens new window) (>=10.20.1)
- npm (>=6.14.4)
- NuxtJS Projekt (opens new window)
# Installation und Konfiguration der hubble PWA
Das hubble Modul ist vefügbar als npm (opens new window) Package und kann über das Terminal via npm
heruntergeladen
und als Nuxt Modul (opens new window) in NuxtJS Projekten eingebunden werden:
- Install NuxtJS (opens new window)
- Install hubble NuxtJs Module
npm i @hubblecommerce/hubble
1
- Add module to nuxt.config.js
buildModules: [
['@hubblecommerce/hubble']
],
/*
** hubble module configuration
*/
hubble: {
apiType: process.env.API_TYPE
},
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
Um die Entwicklung zu beginnen wird eine ~/.env
benötigt, in die Credentials wie API Keys und Auth Token
aus den Admin Bereichen der jeweiligen Services einzutragen sind.
Mehr zur .env unter: Konfiguration.
Es ist folgender Eintrag notwendig in der ~/.env
:
API_TYPE = 'api'
1
# Starten der hubble PWA im Entwicklungsmodus
npm run dev
1
Das hubble Frontend ist nun unter http://localhost:3336/
einsehbar.
# Starten der hubble PWA im Production Modus
npm run build
npm run start
1
2
2