{this.state.any: boolean && <View/>}

 

사전 설치 작업

npm install express mysql --save --save-exact


Server.js

var express    = require('express');
var app = express();

const Router = require('./routes/path');
app.use('/path', Router)

app.set('port', process.env.PORT || 3000);

app.listen(app.get('port'), function () {
  console.log('Express server listening on port ' + app.get('port'));
});

 

 

 

routes/path.js

const db   = require('../config/database');
const express = require('express');
const router = express.Router();


router.get('/', function(req, res){
  // res.send('Error');
  db.query('select * from ()', function (err, rows) {
      if(err){
          throw err;
      }
      console.log(rows);
      res.json(rows);
    });
});

module.exports = router;

 

 

 

config/database.js

const mysql      = require('mysql');
const connection = mysql.createPool({
  host     : 'localhost',
  user     : 'root',
  password : '****',
  port     : 3306,
  database : 'any',
  waitForConnections:false
});

module.exports = connection

htmlentities(urlencode($text))

exports.addUser = functions.https.onRequest(async (req, res) => {
  // Grab the text parameter.
  const user = req.query.user;
  
  // Push the new message into the Realtime Database using the Firebase Admin SDK.
  const snapshot = await admin.database().ref('/users/' + user).push({user: user});
  // Redirect with 303 SEE OTHER to the URL of the pushed object in the Firebase console.
  res.redirect(303, snapshot.ref.toString());
});

 

'Else' 카테고리의 다른 글

(php) get 공백 포함 넘기기  (0) 2019.10.21
url .php 확장자명 숨기기  (0) 2019.08.14
[mysql] mysql, maria db 외부 접속 가능하게 하기  (0) 2019.08.05
[git]Remote: Repository not found.  (0) 2019.07.02

val file = File(param.get("image_path") as String)

val requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file)

val body = MultipartBody.Part.createFormData("uploaded_file", file.getName(), requestFile)
val text = RequestBody.create(MediaType.parse("text/plain"), param.get("text") as String);


ApiClient.client.create(ApiInterface::class.java).upload(body, text)
.enqueue(object : Callback<Void> {
override fun onResponse(call: Call<Void>, response: Response<Void>) {
if (response.isSuccessful) {
if (response.body() != null) {
val result = response.body();
if (result != null) {
onFinishedListener.onFinished()
}
}
}
}

override fun onFailure(call: Call<Void>, t: Throwable) {
onFinishedListener.onFailure(t);
}
})

 

--php

 

$file_path = "./";

$basename = basename( $_FILES['uploaded_file']['name']);

$file_path = $file_path . $basename;
if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $file_path)) {
$result =array("result" => "success");

} else{
$result = array("result" => "error");
}

http.conf

 

<homepath>

Options FollowSymLinks MultiViews
AddType application/x-httpd-php .php

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride FileInfo

linux ubuntu에서의 명령어 입니다.

 

sudo vi /etc/mysql/my.cnf

 

bind 127.0.0.1 부분 주석처리 -> #bind 127.0.0.1

 

 

 

'Else' 카테고리의 다른 글

(php) get 공백 포함 넘기기  (0) 2019.10.21
firebase cloud funtion db에 데이터 추가  (0) 2019.10.21
url .php 확장자명 숨기기  (0) 2019.08.14
[git]Remote: Repository not found.  (0) 2019.07.02

AuthAPNSTokenType.sandbox -> AuthAPNSTokenType.prod

'IOS' 카테고리의 다른 글

(ios)button image에 색 설정 set color in button image  (0) 2018.08.21
function writeFile(fileName, text) {
var blob = new Blob([text], { type: 'text/plain' });

objURL = window.URL.createObjectURL(blob);

if (window.__Xr_objURL_forCreatingFile__) {
window.URL.revokeObjectURL(window.__Xr_objURL_forCreatingFile__);
}
window.__Xr_objURL_forCreatingFile__ = objURL;

var a = document.createElement('a');

a.download = fileName;
a.href = objURL;
a.click();
}

'Web' 카테고리의 다른 글

[javascript] 로컬 파일 불러오기 (chrome)  (0) 2019.07.31

xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest() : window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : alert("use chrome");

xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) {

document.getElementById("id").innerHTML=xmlhttp.responseText;

}

}

xmlhttp.open("GET","test.txt",true);

xmlhttp.send();

'Web' 카테고리의 다른 글

[js] .txt 파일 로컬 저장  (0) 2019.07.31

+ Recent posts