노드js 파일이 웹 호스팅서버로 업로드 안되요

코다두의 이미지

안드로이드와 안드로이드간 1:1 데이터 통신 어플리케이션인데요

한 안드로이드쪽에서 데이터(integer) 를 보내면 서버의 ack 플래그가 꺼지고
그 integer 데이터를 다른 안드로이드가 받으면 서버의 ack가 켜지는 그런 방식의 어플리케이션입니다

그래서 서버에 대해서 잘 모르지만 서로간의 공유된 ack를 만들기 위해서 이런느낌의 node js코드를 만들었습니다
미숙하지만 cmd로 실행한 제 개인 localhost에서는 입력된 url에 따라 잘 인식하는것 같구요...

코드:

var http = require('http');
var url = require('url');
var fs = require('fs') // 파일 로드 사용
 
 
var hostname = '127.0.0.1';
 
 
var sendData=0;
var ack=0;
var ackack=0;
var message = "there is no communication now. <br> ";
 
var app = http.createServer(function(request,response){
     var _url = request.url;
     var queryData = url.parse(_url, true).query;
 
    if((queryData.dat)*= 1 > 0){
    sendData =  queryData.dat;
    message = "sender send data but do not respond now <br>"
    }
 
 
    if(queryData.ack == '1'){
    ack = queryData.ack;
    message = "sender sent, and receiver read it <br>"
    }
    else{
      ack = 0;
    }
 
    if(queryData.ackack == '1'){
      ackack = queryData.ackack;
      message = "receiver responds the answer, and sender read it <br> communication finished ! <br>"
      }
      else{
        ackack = 0;
      }
 
    console.log(ack);
 
    var template = `
              <!doctype html>
              <html>
              <head>
                <title>TEST</title>
                <meta charset="utf-8">
              </head>
              <body>
                <h2>sendData : ${sendData}</h2>
                <h2>ack : ${ack} </h2>
                <h2>ack-ack : ${ackack} </h2>
 
                <p>I wish this will work well.<br>
                ${message} </p>
 
              </body>
              </html>
              `;
              response.writeHead(200);
              response.end(template);
 
}).listen(80,hostname); //80 is port

코드는 받아온 url을 파싱하여 sendData , ack, ack-ack 에 대한 입력값을 분석해서
웹의 변수에 그 값(var sendData 같은 것) 을 저장하는 역할을 수행하고 있습니다
안드로이드가 나중에 요청하면 그 값을 읽을 수 있게 할 것이구요...

그래서 위 js 파일을 heroku 라는 곳에 git을 통해 push를 하려고 하니까

"Heroku cannot detect the buildpack to use for this application automatically"
라고 하면서 푸시가 안되는데 도통 이유를 모르겠어서요...

이유를 알고계시다면 조언좀 부탁드립니다. 감사합니다

김정균의 이미지

혹시 글 등록 하실 때 다음의 내용이 안보이시던가요?

댓글 첨부 파일: 
첨부파일 크기
Image icon screenshot.png89.53 KB
peecky의 이미지

혹시 package.json 이 없는 상태라면
npm init
명령어로 package.json 파일을 생성한 후 push 해보세요.

그래도 안되면 https://dashboard.heroku.com/ 에서 Buildpacks 설정해보세요.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.