Skip to content
Snippets Groups Projects
Commit 53dcd5fc authored by Hermann's avatar Hermann
Browse files

move api url to config

parent 09a2e032
No related branches found
No related tags found
No related merge requests found
import axios from 'axios';
import * as localStorage from './localStorage';
import { apiUrl } from './config.json';
// Object which stores the current login-state
const APISession = {
......@@ -8,7 +9,7 @@ const APISession = {
};
const amivapi = axios.create({
baseURL: 'https://amiv-api.ethz.ch/',
baseURL: apiUrl,
timeout: 10000,
headers: { 'Content-Type': 'application/json' },
});
......@@ -59,7 +60,7 @@ export function getSession() {
checkAuthenticated().then((authenticated) => {
if (authenticated) {
const authenticatedSession = axios.create({
baseURL: 'https://amiv-api.ethz.ch/',
baseURL: apiUrl,
timeout: 10000,
headers: {
'Content-Type': 'application/json',
......
{
"apiUrl": "https://amiv-api.ethz.ch/",
"Users": {
"keyDescriptors": {
"legi": "Legi Number",
......
import Ajv from 'ajv';
import { ItemView } from './itemView';
import { getSession } from '../auth';
import { apiUrl } from '../config.json';
const m = require('mithril');
......@@ -53,7 +54,7 @@ export class EditView extends ItemView {
});
}
// load schema
m.request('http://amiv-api.ethz.ch/docs/api-docs').then((schema) => {
m.request(`${apiUrl}docs/api-docs`).then((schema) => {
const objectSchema = schema.definitions[
objectNameForResource[this.resource]];
this.ajv.addSchema(objectSchema, 'schema');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment