반응형

Node.js | split() function

function splitStr(str) {
     
    // Function to split string
    var string = str.split("*");
     
    console.log(string);
}
 
// Initialize string
var str = "Welcome*to*GeeksforGeeks";
 
// Function call
splitStr(str);
반응형
반응형

First, you set the public (folder) as static in the server.js

server.js

// configure our application
const Express = require('express');
const app = new Express();
.......
.......
app.use(Express.static(__dirname+'/public'));
.......

then your html file

<img class="logo" src="/images/Heading.png" alt="My_Logo">

your images path location-

project(root folder) \ public \ images\ Heading.png

반응형
반응형

nodeJS의 무중단 관리도구인 Forever 에 대해 알아보겠습니다

node . js 앱을 실행시키거나 비정상 종료되었을 때 재실행을 시켜주는 관리도구입니다

1.forever 설치

npm install forever -g
 

2.forever 시작

forever start [js script]
 

3.forever 종료

forever stop [js script]
 

4.forever 목록

forever list

반응형
반응형

'Node.js 모범 사례'

 

       1. 프로젝트 구조 설계

       2. 에러 처리 방법

       3. 코드 스타일

       4. 테스트 및 전체 품질 관리

       5. 운영 환경으로 전환하기

       6. 보안

       7. 성능

 

https://github.com/goldbergyoni/nodebestpractices/blob/master/README.korean.md

 

goldbergyoni/nodebestpractices

:white_check_mark: The Node.js best practices list (May 2020) - goldbergyoni/nodebestpractices

github.com

 

반응형
반응형

[NodeJS] Realtime Chat with Node.js


http://tutorialzine.com/2014/03/nodejs-private-webchat/


In this tutorial, we are going to build a realtime chat system with Node.js and the socket.io library. The chat permits users to create private chat rooms that they can share with a friend. For avatars, we will use gravatar. You can run the chat locally with node, or push it to heroku or a different cloud service provider.

The code

You can grab the source code from the download button above. It has plenty of comments and is easy to follow. Start with the app.js file and read from there. Here are a few things to look for:

  • All dependencies are declared in the package.json file. They are not included in the zip and you will have to run npm install to get them.
  • We are using separate JavaScript files for the configuration and routes, to make the code more manageable.
  • In the routes file, socket.io stores the username, avatar and room of the person as properties of the socket object itself. This saves us a lot of code and makes managing rooms easy.
  • We use socket.io‘s rooms feature to isolate one chat from another, which is exactly what that feature was developed for.
Enter your name to chat

Enter your name to chat


반응형
반응형

A-Frame: A framework for the virtual reality web

 

A-Frame

For the core library, check out A-Frame Core.

Building blocks for the VR Web.

  • Virtual Reality: Drop in the library and have a WebVR scene within a few lines of markup.
  • Based on the DOM: Manipulate with JavaScript, use with your favorite libraries and frameworks.
  • Entity-Component System: Use the entity-component system for better composability and flexibility.

Find out more:

 

 

A-Frame is a framework for building things for the virtual reality web. You can use markup to create VR experiences that work across desktop, iPhones, and the Oculus Rift.

a-frame

 

 

 

 

 

.

반응형
반응형

CodeceptJS: Acceptance testing for NodeJS

CodeceptJS offers modern era acceptance testing for NodeJS. It’s scenario driven, backend agnostic, and uses an interactive shell.

codeceptjs


반응형
반응형

서버구입 없이 RoR, Nodejs, Django, Go 개발 및 Publishing 을 경험해 볼 수 있는 웹기반 '무료' 서버입니다.

 

https://www.nitrous.io/

 

Nitrous.IO - Develop in the Cloud

 

 

반응형

+ Recent posts