This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Structure | |
app.js: main file, houses the embedded server and application logic | |
/public: contains static files to be served by the embedded server | |
/routes: houses custom routing for the REST API servers (not needed for a web app) | |
/routes/users.js: endpoint/routes for resources such as users | |
/views: contains templates that can be processed by a template engine (not needed for REST APIs) | |
/package.json: project manifest | |
/www: boot up script folder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//server.js | |
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
const errorHandler = require('errorhandler'); | |
const morgan = require('morgan'); | |
const routes = require('./routes'); | |
let app = express(); | |
app.use(bodyParser.json()); // support json encoded bodies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Html css: | |
https://scrimba.com/@perborgen - CSS GRID , felxbox others | |
https://scrimba.com/g/gintrotocss - basic css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.quora.com/Do-we-put-the-footer-inside-body | |
https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML/Document_and_website_structure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table | |
listing ( | |
id varchar(255) not null PRIMARY KEY, | |
currency varchar(3) not null, | |
description varchar(255) not null, | |
listing_price integer, | |
listing_status Integer NOT NULL, | |
location_id varchar(255) not null, | |
marketplace integer not null, | |
title varchar(255) not null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nowUtc = new Date( new Date().getTime() + (new Date().getTimezoneOffset() * 60000)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream api_server { | |
server app.company:1234; | |
} | |
server { | |
listen 80; | |
server_name app.my.client.com; | |
root /home/sovietspy2/www/app; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream api_server { | |
server app.company:1234; | |
} | |
server { | |
listen 80; | |
server_name app.my.client.com; | |
root /home/sovietspy2/www/app; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("dotenv-safe").config(); | |
const url = require("url"); | |
const now = require("./now.json"); | |
const routes = now.routes | |
.filter(route => | |
now.builds.some( | |
build => | |
build.src.startsWith(`${route.dest.substring(1)}/`) && |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<header> | |
<h1>Super duper best blog ever</h1> | |
<nav> | |
<a href="/">Home</a> | |
<a href="/about">About</a> | |
<a href="/archive">Archive</a> | |
</nav> | |
</header> | |
<main> | |
<article> |