server {
listen 80 default_server;
server_name 128.199.174.129;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
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
$(document).ready(function(){ | |
$("#uploadForm").submit(function(event){ | |
// disable the default form submission | |
event.preventDefault(); | |
//grab all form data | |
var formData = new FormData($(this)[0]); | |
$.ajax({ | |
url: 'http://localhost:3001/api/signup', | |
headers: { |
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
const express = require('express'); | |
const fileUpload = require('express-fileupload'); | |
const bodyParser = require('body-parser'); | |
const app = express(); | |
// default options | |
app.use(fileUpload()); | |
app.use(bodyParser.urlencoded({extended: false})); | |
app.use(bodyParser.json()); | |
app.use(function (req, res, next) { |
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> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> | |
<script> | |
$(document).ready(function(){ | |
$("#uploadForm").submit(function(event){ | |
// disable the default form submission | |
event.preventDefault(); | |
//grab all form data |
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 Mongoose = require('mongoose'); | |
var autoIncrement = require('mongoose-auto-increment') | |
var Schema = Mongoose.Schema; | |
// Mongoose.Promise = require('bluebird'); | |
var db = Mongoose.connect('mongodb://localhost/Population', { | |
useMongoClient: true | |
}, (err) => { | |
if (err) { | |
console.log(`Can't connect to MongoDB`); |
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
const express = require('express'); | |
const mongoose = require('mongoose'); | |
const app = express(); | |
mongoose.connect('mongodb://localhost/test'); | |
var Schema = mongoose.Schema; | |
var personSchema = Schema({ | |
_id: Schema.Types.ObjectId, |
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
const express = require('express'); | |
const mongoose = require('mongoose'); | |
const autoIncrement = require('mongoose-auto-increment'); | |
const app = express(); | |
mongoose.connect('mongodb://localhost/test'); | |
var Schema = mongoose.Schema; | |
var personSchema = Schema({ |
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
function getAllCity(req, res) { | |
var promise = Q.fcall(function() { | |
return City.find({}, function(err, cities) { | |
if(err) { | |
console.log(err); | |
return res.send(404) | |
} | |
for (let i = 0; i < cities.length; i++) { | |
Location.findOne({_id : cities[i].locationId}, function(err, location){ | |
if(err) return; |
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
myApp.directive('ngFileModel', ['$parse', function ($parse) { | |
// return { | |
// restrict: 'A', | |
// link: function(scope, element, attrs) { | |
// var model = $parse(attrs.ngFileModel); | |
// var modelSetter = model.assign; | |
// element.bind('change', function(){ | |
// scope.$apply(function(){ | |
// modelSetter(scope, element[0].files[0]); |
Slide 1.
Mục tiêu của buổi offline
Slide 2.
Nội dung của buổi offline
Các kỹ năng cần có của một Frontend Dev