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 app = express(); | |
const debug = require('debug')('myapp:server'); | |
const path = require('path'); | |
const multer = require('multer'); | |
const logger = require('morgan'); | |
const serveIndex = require('serve-index') | |
var storage = multer.diskStorage({ | |
destination: (req, file, cb) => { |
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 debug = require('debug')('nyapp:userrouter'); | |
const multer = require('multer'); | |
const path = require('path'); | |
//set the storage destination and naming | |
var storage = multer.diskStorage({ | |
destination: (req, file, cb) => { | |
cb(null, '../public/uploads') |
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
import Foundation | |
struct User { | |
let name: String | |
let gender: String | |
let email: String | |
} |
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
// | |
// ViewController.swift | |
// TableViewDemo | |
// | |
// Created by Bilguun Batbold on 22/2/19. | |
// Copyright © 2019 ISEM. All rights reserved. | |
// | |
import UIKit |
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
// | |
// UserView.swift | |
// TableViewDemo | |
// | |
// Created by Bilguun Batbold on 22/2/19. | |
// Copyright © 2019 ISEM. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
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
import Foundation | |
public struct User { | |
let name: String | |
let gender: String | |
let email: String | |
} | |
public class UserManager { | |
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
import Foundation | |
import UIKit | |
public class UserDataSourceProvider: NSObject, UITableViewDelegate, UITableViewDataSource { | |
//private var to hold the user manager | |
private let userManager: UserManager | |
//initialize the user manager |
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
import UIKit | |
class ViewController: UIViewController { | |
//declare an outlet and connect to the tableview previously created | |
@IBOutlet weak var usersTableView: UITableView! | |
private var userManager = UserManager() | |
//initialize after self is available |
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
import UIKit | |
class ViewController: UIViewController { | |
private let refreshControl = UIRefreshControl() | |
//declare an outlet and connect to the tableview previously created | |
@IBOutlet weak var usersTableView: UITableView! | |
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
// | |
// User.swift | |
// TableViewDemo | |
// | |
// Created by Bilguun Batbold on 22/2/19. | |
// Copyright © 2019 ISEM. All rights reserved. | |
// | |
import Foundation |
OlderNewer