1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

A-FrameでCORSエラーが出た

Posted at

ローカルで、A-Frameを使って360度カメラで撮った写真をウェブ上に表示させようとしたら、

index.html
<!doctype html>
 <html>
  <head>
   <meta charset="utf-8">
   <title>ページのタイトル</title>
     <script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script>
  </head>
  <body>
   <a-scene>
        <a-sky src="pic1.jpeg" rotation="0 0 0"></a-sky>
   </a-scene>
  </body>
 </html>

こんなエラーが出た。

Image from Gyazo


そこで、http-serverをインストールして、ローカルホストにアクセスしたら、エラーは出ず、360度カメラの画像が表示された。
$ npm install -g http-server

$ http-server

サーバーが立ち上がったら、
http://localhost:8080/ 
にアクセスする。


1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?