diff --git a/doccano/app/app/urls.py b/doccano/app/app/urls.py index fe472375..6ee656bd 100644 --- a/doccano/app/app/urls.py +++ b/doccano/app/app/urls.py @@ -18,6 +18,6 @@ from django.urls import path, include urlpatterns = [ - path('annotation/', include('server.urls')), + path('projects/', include('server.urls')), path('admin/', admin.site.urls), ] diff --git a/doccano/app/server/static/main.js b/doccano/app/server/static/main.js index 8a2f404a..98459a4f 100644 --- a/doccano/app/server/static/main.js +++ b/doccano/app/server/static/main.js @@ -37,13 +37,13 @@ var app = new Vue({ }, ], labels: [], - guideline: 'annotation guideline' + guideline: '' }, methods: { addLabel: function (label) { this.items[this.cur]['labels'].push({ - "text": label, - "prob": null + 'text': label, + 'prob': null }) }, deleteLabel: function (index) { @@ -58,8 +58,9 @@ var app = new Vue({ }, created: function () { console.log('created'); + var base_url = window.location.href.split('/').slice(3, 5).join('/'); var self = this; - axios.get('/annotation/api/label') + axios.get('/' + base_url + '/apis/label') .then(function (response) { console.log('label request'); self.labels = response.data['labels']; diff --git a/doccano/app/server/urls.py b/doccano/app/server/urls.py index 785bd822..5738317c 100644 --- a/doccano/app/server/urls.py +++ b/doccano/app/server/urls.py @@ -3,7 +3,7 @@ from django.urls import path from .views import AnnotationView, AnnotationAPIView, LabelAPIView urlpatterns = [ - path('', AnnotationView.as_view()), - path('api/annotation/', AnnotationAPIView.as_view()), - path('api/label/', LabelAPIView.as_view()), + path('/docs', AnnotationView.as_view()), + path('/apis/data', AnnotationAPIView.as_view()), + path('/apis/label', LabelAPIView.as_view()), ]