在此视频中,我介绍了如何将express.js添加到您的节点应用程序中以提供静态文件。
源代码:https://github.com/shiffman/Video-Lesson-Materials
联系人:https://twitter.com/shiffman
下一个视频:https://youtu.be/HZWmrt3Jy10
节点:https://nodejs.org/en/
Socket.io:http://socket.io/
快递:http://expressjs.com/
p5.js:https://p5js.org/
了解JavaScript基础知识:
有关数据和API的更多信息:
帮助我们字幕和翻译此视频!
http://amara.org/v/Qbsr/
Conduct行为准则:https://github.com/CodingTrain/Code-of-Conduct。
where from can i install that libraries you use?
look at him a happy pre-corona era man 😀
it works but then when I update my script.js file it won't update in the browser. Even if I ctrl C in the command line and then node server.js in command line and then refresh browser
Thank you Daniel. Working fine: I saved a model.json but then could not load it in the browser. Running well from localhost… The code can recognize my daughter and my wife by now. will improve including myself and the cats.
I get this error: Refused to load the image 'http://localhost:3000/favicon.ico' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.
For those that are not able to get the ellipse at 10:40 try editing your index.html file by replacing the script lines (not the one with sketch.js but the other ones) to include "libraries/" at the front of the js file in the src attribute.
i.e. change
<script src="p5.js"></script>
to
<script src="libraries/p5.js"></script>
repeat with the other lines.
When i did this on mac, i used npm install –save express because your command gave me an error. Great stuff!
If I use require() in my p5 sketch.js file in the public folder I get an error message in the console saying require is not defined. Is there a way to use require() inside the sketch.js file?
Going to my first software developer job interview thanks to you and all your tutorials! Thank you so much, you changed my life.
This is so easy to follow and yet so interesting and entertaining! Thank you so much for those great videos!
so I got stuck because I couldnt get javascript to draw stuff when I opened the html page through localhost:3000 (using server.js and express)
I later realized all the p5 files (p5.js, p5.min.js etc…) also need to be in the public folder, along with the sketch file, for it to actually draw stuff
Anyone know where's the 10:56 video?
Only an Apple user would replace "it downloads and installs the package" with "magic, magic, magic, blah, blah, blah, boring" 😛
This does not work with Windows
Thank you Daniel!
Dude you rock !!
Could you take a look at blessed server (node.js) over web sockets to xterm.js client (browser)? I can't seem to get it to work.
At 10:40, I am not able to see ellipse, just a blank page is coming. PLEASE HELP
Where is that python video?
Does anyone know why I am getting the "Cannot GET /" error on localhost:3000 but my sketch is showing locally if i bring it up and open it as regular URL(saving the html file and then double clicking it)? I have tried using multiple ports as well
It won't download the express to my package
App everyone knows the best abbreviation for application is lication, it just sounds more natural
npm is not actually an acronym. npm stands for npm.
oh men, i finally i made my first webpage with p5.js hosted by node.js. thank u sir. if you were my professor in college it will not be boring and dull.enjoy ur video
5:14 In my case the program is creating a package-lock.json file which look quite different from you example
Please help. Tried this code.
Doesn't serve anything. but the error message in firefox says
http://localhost:3000/server.js” was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff).
any help .. thanks !!
Hi nice videos, qq, wich program do i need to create websites in node,js and have some xgnix to develop
When I add the code to sketch.js to show the canvas, going on localhost:3000 I can see only a blank page… Why?
but how do i make it so that my server is live on the internet
I listen on port 3000,
Not much has changed but they live underwater,
And your great, great, great grand daughter is doing fineeeee
i need help. can you please provide me a guidance. i made an gps traker module but i have some confusion and doubts
Our GPS Tracking device send data to server through HTTP Protocols in stream.
after connection establishments, send 19-charterer ASCII string Device ID using HTTP POST request.
for example: "#863586032468872*#nr"
after that
38-charterer ASCII string send every 2 or 3 seconds using HTTP POST request.
for example: "#22.73688886,#75.88336181,#000,#98*#nr"
(latitude, longitude, speed, battery status)
i have search all the way but didn't get perfect solution
your videos are the best