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
{"version":1,"resource":"vscode-userdata:/Users/kaungmyatlwin/Library/Application%20Support/Code/User/settings.json","entries":[{"id":"jslQ.json","timestamp":1650265248517}]} |
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 router = require('express').Router(); | |
const upload = require('./upload')('./cats'); | |
router.post('/', upload.array('photos', 10), (req, res) => { | |
// handle logic | |
res.send('ok'); | |
}); | |
module.exports = router; |
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 router = require('express').Router(); | |
const multer = require('multer'); | |
const storage = multer.diskStorage({ | |
destination: (req, file, cb) => { | |
cb(null, './cats'); | |
}, | |
filename: (req, file, cb) => { | |
const fname = `${Date.now()}-${encodeURIComponent(file.originalname)}`; | |
cb(null, fname); |
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
module.exports = [{ | |
region_pcode_idx: 1, | |
name_en: 'Kachin', | |
name_mm: 'ကချင်ပြည်နယ်', | |
region_pcode: 'MMR001', | |
type: 'state', | |
}, { | |
region_pcode_idx: 2, | |
name_en: 'Kayah', | |
name_mm: 'ကယားပြည်နယ်', |
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 config = require('config'); | |
const MongoClient = require('mongodb').MongoClient; | |
const { host } = config.get('dbConfig'); | |
const mongoIp = process.env.NODE_ENV === 'production' ? host : 'localhost'; | |
class Connection { | |
static databases = {}; | |
static connectToMongo(dbName: string, options: object) { |
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 React from "react"; | |
import ReactDOM from "react-dom"; | |
import EditableText from "./EditableText"; | |
import "./styles.css"; | |
function App() { | |
return ( | |
<div className="App"> | |
<h1>Editable Text Demo</h1> |
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 React from "react"; | |
import ReactDOM from "react-dom"; | |
import EditableText from "./EditableText"; | |
import "./styles.css"; | |
function App() { | |
return ( | |
<div className="App"> | |
<h1>Editable Text Demo</h1> |
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 React, { useState, useRef, useEffect } from "react"; | |
const EditableInput = props => { | |
return ( | |
<React.Fragment> | |
<input /> | |
<span></span> | |
</React.Fragment> | |
); | |
}; |
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 React, { useState, useRef,useEffect } from 'react'; | |
const EditableInput = ({ | |
onChange, | |
text, | |
placeholder, | |
}) => { | |
const inputRef = useRef(null); | |
const [inputVisible, setInputVisible] = useState(false); |
NewerOlder