프론트엔드 언어

HTML

HTML
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Hello, World!</title>
  </head>
  <body>
    <!-- 페이지에 "Hello, World!" 출력 -->
    <h1>Hello, World!</h1>
  </body>
</html>
Click to expand and view more

CSS

CSS
/* HTML의 h1 요소에 스타일 설정 */
h1 {
  color: blue; /* 텍스트 색상을 파란색으로 */
  text-align: center; /* 텍스트를 가운데 정렬 */
}
Click to expand and view more

JavaScript

JAVASCRIPT
// 브라우저 콘솔에 "Hello, World!" 출력
console.log('Hello, World!');
Click to expand and view more

TypeScript

TYPESCRIPT
// TypeScript에서 "Hello, World!" 출력
let message: string = 'Hello, World!'; // 문자열 변수 선언
console.log(message); // 콘솔에 출력
Click to expand and view more
TS
type CommonRequest = Omit<RequestInit, 'body'> & { body?: URLSearchParams };

export async function request(url: string, init?: CommonRequest) {
  if (import.meta.env.DEV) {
    const nodeFetch = await import('node-fetch');
    const https = await import('node:https');

    const agent = url.startsWith('https')
      ? new https.Agent({ rejectUnauthorized: false })
      : undefined;

    return nodeFetch.default(url, { ...init, agent });
  }

  return fetch(url, init);
}
Click to expand and view more

React.js

TSX
import { RemixBrowser } from '@remix-run/react';
import { startTransition } from 'react';
import { hydrateRoot } from 'react-dom/client';

startTransition(() => {
  hydrateRoot(document.getElementById('root')!, <RemixBrowser />);
});
Click to expand and view more

Vue.js

JAVASCRIPT
// Vue.js 사용법, 페이지에 "Hello, World!" 표시
const app = Vue.createApp({
  data() {
    return {
      message: 'Hello, World!',
    };
  },
});
app.mount('#app');
Click to expand and view more

해당 HTML 코드:

HTML
<div id="app">{{ message }}</div>
Click to expand and view more

백엔드 언어

Node.js (JavaScript)

JAVASCRIPT
// 쉬운 서버 생성 및 "Hello, World!" 반환
const http = require('http');

// 서버 생성
http
  .createServer((req, res) => {
    res.writeHead(200, { 'Content-Type': 'text/plain' }); // 응답 헤더 설정
    res.end('Hello, World!\n'); // "Hello, World!" 반환
  })
  .listen(3000);

console.log('Server running at http://localhost:3000');
Click to expand and view more

Python

PYTHON
# "Hello, World!"를 터미널에 출력
print("Hello, World!")
Click to expand and view more

Django (Python 웹 프레임워크)

뷰 코드:

PYTHON
from django.http import HttpResponse

# "Hello, World!"를 반환하는 뷰 함수
def hello_world(request):
    return HttpResponse("Hello, World!")
Click to expand and view more

Java

JAVA
// 터미널에 "Hello, World!" 출력
public class Main {
    public static void main(String[] args) {
        System.out.println("Hello, World!"); // 표준 출력 사용
    }
}
Click to expand and view more

Kotlin

KOTLIN
// 터미널에 "Hello, World!" 출력
fun main() {
    println("Hello, World!") // Kotlin의 출력 함수
}
Click to expand and view more

PHP

PHP
<?php
// 페이지에 "Hello, World!" 출력
echo "Hello, World!";
?>
Click to expand and view more

Ruby

RUBY
# 터미널에 "Hello, World!" 출력
puts "Hello, World!"
Click to expand and view more

Go

GO
// 터미널에 "Hello, World!" 출력
package main

import "fmt"

func main() {
    fmt.Println("Hello, World!") // 문자열 출력
}
Click to expand and view more

C#

CSHARP
// 터미널에 "Hello, World!" 출력
using System;

class Program {
    static void Main() {
        Console.WriteLine("Hello, World!"); // 문자열 출력
    }
}
Click to expand and view more

Rust

RUST
// 터미널에 "Hello, World!" 출력
fn main() {
    println!("Hello, World!"); // 표준 출력에 출력
}
Click to expand and view more

Swift

SWIFT
// 터미널에 "Hello, World!" 출력
print("Hello, World!") // Swift의 출력 함수
Click to expand and view more

PHP Laravel (백엔드 프레임워크)

컨트롤러 예시:

PHP
// Laravel 프레임워크에서 "Hello, World!" 반환
Route::get('/', function () {
    return 'Hello, World!';
});
Click to expand and view more

SQL

SQL
-- 간단한 쿼리 예제, 'Hello, World!' 반환
SELECT 'Hello, World!';
Click to expand and view more

Copyright Notice

Author: heyjude

Link: https://heyjude.blog/ko/posts/hugo_clarity_integration/

License: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Please attribute the source, use non-commercially, and maintain the same license.

Comments

검색 시작

검색어를 입력하세요

↑↓
ESC
⌘K 단축키