lun3x / WebTech

1 stars 0 forks source link

All the server stuff + deployment #36

Open ahmerb opened 6 years ago

ahmerb commented 6 years ago

Server: this is creating or adapting a server, either programming it yourself or using express and its add-ons

C means you've created a server by minimally adapting the one provided, or closely following a tutorial to set up express B means you've dealt with things like port numbers, URL validation, content negotiation for old browsers, sending redirections to browsers, handling UTF-8 A means you've dealt with things like https and certificates, or web sockets, or cloud hosting, or security issues beyond URL validation, or auto-testing, or cookies, or running under reduced privilege

ahmerb commented 6 years ago

Ports Done the following.

Refactor server so start point is the module ./server/index.js and it imports the app from ./app.js, where the app sets up middleware chain etc.

In server.js, we do the following:

ahmerb commented 6 years ago

Also added morgan logging framework.

ahmerb commented 6 years ago

URL validation Dont' really know what this is. Currently, if a URL doesn't match an api route or home page, we return a 404. Going to mark as done for now. According to this , we just need to ensure that urls start with http:// or https:// server side.

ahmerb commented 6 years ago

Content Negotiation Servers text/html or application/xhtml+xml depending on request headers.

ahmerb commented 6 years ago

Deploy to heroku

Deployed to heroku. See readme. Setup with redis-heroku, jawsdb (mysql), db-migrate scripts etc, postinstall script, set up db and seeded it. See readme / my notes for more info.

Now, on local can run with heroku local and cd frontend && npm run devbuild. To deploy, on master branch only, do git push heroku master. Make sure its working with heroku local first.

ahmerb commented 6 years ago

HTTPS & Certificates Done by @lun3x