Skip to content

Commit b135abd

Browse files
author
Lee Richmond
committed
Ensure endpoint starts with /
1 parent 90ac064 commit b135abd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
const Staffer = Model.extend({
1414
static: {
1515
jsonapiType: 'staffers',
16-
apiNamespace: '/v1/',
16+
apiNamespace: '/v1',
1717
baseUrl: 'http://localhost:3000/api'
1818
},
1919

src/model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export default class Model {
7878
}
7979

8080
static url(id?: string | number) : string {
81-
let endpoint = this.endpoint || this.jsonapiType;
81+
let endpoint = this.endpoint || `/${this.jsonapiType}`;
8282
let base = `${this.baseUrl}${this.apiNamespace}${endpoint}`;
8383

8484
if (id) {

0 commit comments

Comments
 (0)