Posts

Showing posts from February, 2021

viewstl.com STL viewer implementation / GET으로 파일URL추가해서 넣기.

Image
 As I made node app with STL viewer.  I installed viewstl.com's js app as STL viewer.  But, I would like to generate STLviwer with different files.  So, I studied online blogs and youtube videos.  I found that I can use HTTP GET request for stl file name as parameters like  http://host/stlview/:id then I can get :id as req.params.id and it can be used as stl filename.  I got two things comes up.  One is CORS I solved this from (https://enable-cors.org/server.html) for Apache as webserver and as webdav server and for express. Two is HTTP GET params.id called twice with wrong parameters.  So, I tried query like this: http://host/stlview?id=fileurl Then It works like a charm.  I am so happy to solve this issue in 3 weeks of struggling.  --------------------------------------------------------------------------- 한국어 3줄요약 1. STL viewer를 실행하는데, STL파일URL을 전달하고 싶은데, POST로 하니, 피곤한게 많아짐.  2. 결국은 GET으로 해서 id=fileurl을 전달하니, CORS때문에 안되다가 해결...