Browse Source

Fixed API link for production build

master
Shyim 7 years ago
parent
commit
18bdb8049c
  1. 3
      public/theme/src/main.js
  2. 1
      src/Controller/Events.php
  3. 2
      src/Controller/Index.php
  4. 3
      templates/index.twig

3
public/theme/src/main.js

@ -23,8 +23,7 @@ const router = new VueRouter({ @@ -23,8 +23,7 @@ const router = new VueRouter({
});
Vue.router = router;
axios.defaults.baseURL = `http://streamer.miku/api`;
axios.defaults.baseURL = typeof appUrl === 'undefined' ? `http://streamer.miku/api` : appUrl;
Vue.use(VueAxios, axios);
Vue.use(VueNotify);

1
src/Controller/Events.php

@ -4,7 +4,6 @@ namespace App\Controller; @@ -4,7 +4,6 @@ namespace App\Controller;
use App\Entity\Streams;
use App\Repository\StreamsRepository;
use Monolog\Logger;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;

2
src/Controller/Index.php

@ -10,7 +10,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller; @@ -10,7 +10,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class Index extends Controller
{
/**
* @Route(path="/")
* @Route(path="/", name="index")
* @author Soner Sayakci <shyim@posteo.de>
*/
public function index()

3
templates/index.twig

@ -10,6 +10,9 @@ @@ -10,6 +10,9 @@
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700,300" rel=stylesheet type=text/css>
<link href="/static/css/nucleo-icons.css" rel=stylesheet>
<link href="/static/css/app.css" rel=stylesheet>
<script>
var appUrl = '{{ absolute_url(path('index')) }}api';
</script>
</head>
<body>
<div id=app></div>

Loading…
Cancel
Save