I wrote a fun website for my friends to generate passwords, but now I want to implement Google Material Design into my site, and it looks like I need NPM to do this.
The problem arose because I started my site with just the website template, not the node.js one.
So how to I convert my normal website into a Node.js website on Glitch?
If you add a
package.json to your project, Glitch will recognize it being a node.js application. You’ll need to specify the start script and the dependencies of your project in package.json, then write a backend to serve files, etc. I am assuming you’re familiar with node.js development
etamponi is right!
what i normally do, because this happens to me A LOT lol:
- open glitch.com/edit/#!/hello-express (our create new project option hello-express) in a new tab
- create new files in my app
server.js and copy and paste the content of those files from hello-express into my app
- i rename my index.html file to
views/index.html since that’s what the server.js index route is trying to send
- i rename any static files to be in a public folder - like style.css to
This worked perfectly! Thank you!