This file contains hidden or 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
// vue.config.js | |
module.exports = { | |
// options... | |
devServer: { | |
disableHostCheck: true | |
} | |
} |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>repl.it</title> | |
<link href="style.css" rel="stylesheet" type="text/css" /> | |
</head> | |
<body> | |
<div class="green"> |
This file contains hidden or 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
[ | |
{ | |
"name":"Yishun", | |
"coordinates":[1.4304, 103.8354] | |
}, | |
{ | |
"name":"Bedok", | |
"coordinates":[1.3236, 103.9273] | |
}, | |
{ |
This file contains hidden or 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
ones = a % 10 | |
tens = a // 10 % 10 | |
temp = ones | |
ones = tens | |
tens = temp | |
print(tens, ones) |
This file contains hidden or 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
// SETUP | |
const express = require('express'); | |
const hbs = require('hbs'); | |
const wax = require('wax-on'); | |
let app = express(); | |
// set which view engine to use | |
app.set('view engine', 'hbs'); | |
// set where to find the static files |
This file contains hidden or 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
const MongoClient = require("mongodb").MongoClient; | |
// global variable | |
let _db; | |
async function connect(url, dbname) | |
{ | |
let client = await MongoClient.connect(url, { | |
useUnifiedTopology:true | |
}); |
This file contains hidden or 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
// EXPRESS AND OTHER SETUP | |
const express = require('express'); | |
const MongoUtil = require('./MongoUtil.js') | |
const hbs = require('hbs') | |
const wax = require('wax-on') | |
// load in environment variables | |
require('dotenv').config(); | |
// create the app |
This file contains hidden or 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
[ | |
{ | |
"_id":1, | |
"sku":"ACME-001", | |
"name":"ACME Chainsaw", | |
"price": 120.50, | |
"imageUrl": "https://www.stihlusa.com/WebContent/Images/Product/1550/ms251.png?preset=Product.ProductDetails" | |
}, | |
{ | |
"_id":2, |
This file contains hidden or 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
const express = require("express"); | |
const hbs = require("hbs"); | |
const wax = require("wax-on"); | |
const mysql = require("mysql2/promise"); | |
let app = express(); | |
app.set("view engine", "hbs"); | |
app.use(express.static("public")); | |
wax.on(hbs.handlebars); | |
wax.setLayoutPath("./views/layouts"); |
This file contains hidden or 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
const express = require("express"); | |
const hbs = require("hbs"); | |
const wax = require("wax-on"); | |
require("dotenv").config(); | |
// create an instance of express app | |
let app = express(); | |
// set the view engine | |
app.set("view engine", "hbs"); |