Skip to content

Commit

Permalink
Merge pull request #2 from dpigera/netlify
Browse files Browse the repository at this point in the history
Added environment switch
  • Loading branch information
dpigera authored Jan 10, 2025
2 parents 42eaa13 + 0790478 commit 3c38aac
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
20 changes: 20 additions & 0 deletions app/config/environment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use strict';

module.exports = function (environment) {
let ENV = {
modulePrefix: 'your-app-name',
environment,
rootURL: '/',
locationType: 'history',

pocketbase: {
url: environment === 'production'
? 'https://gauntlet-chatgenius-pocketbase-2.fly.dev'
: 'http://127.0.0.1:8090'
},

// ... other config
};

return ENV;
};
6 changes: 3 additions & 3 deletions app/services/pocketbase.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import Service from '@ember/service';
import PocketBase from 'pocketbase';
import { tracked } from '@glimmer/tracking';
// import { inject as service } from '@ember/service';
// import config from '../config/environment';
import { inject as service } from '@ember/service';
import config from '../config/environment';

export default class PocketbaseService extends Service {
@tracked currentUser = null;

constructor() {
super(...arguments);
this.client = new PocketBase('http://127.0.0.1:8090');
this.client = new PocketBase(config.pocketbase.url);
}

get name() {
Expand Down

0 comments on commit 3c38aac

Please sign in to comment.