heroku is giving me Method not allowed

Okay, so I’ve been on this problem for hours now with no idea how to solve this since I’m just a newbie. I was following a UDEMY course titled WEBDEVBOOTCAMP by Colt Steele. On the deployment section, every time I deploy using Heroku, this gives me a “Method not allowed”. I’ve been following Colt’s ways … Read more

Enabling HTTPS on express.js

In express.js (since version 3) you should use that syntax: In that way you provide express middleware to the native http/https server If you want your app running on ports below 1024, you will need to use sudo command (not recommended) or use a reverse proxy (e.g. nginx, haproxy).

NodeJS w/Express Error: Cannot GET /

You typically want to render templates like this: However you can also deliver static content – to do so use: Now everything in the /public directory of your project will be delivered as static content at the root of your site e.g. if you place default.htm in the public folder if will be available by visiting /default.htm Take a look … Read more

MissingSchemaError: Schema hasn’t been registered for model “User”

In my models/user.js file: And in my router/index.js, I have: which throws the error: If however, in user.js, I do (in the last line) and in index.js I do var User = require(‘../models/User’);, then everything works. But it should not, because in config/pass.js I am doing var User = mongoose.model(‘User’); and it’s working flawlessly. The … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)