Library Search
结果页01-hello-world-http-server
在 知识库 中找到 8 个匹配结果。
知识库
知识库
8 个 01-hello-world-http-server # Node.js Hello World — HTTP 服务器
## 目标
用 Node.js 内置 `http` 模块创建一个最简单的 Web 服务器,监听 3000 端口,返回 JSON 格式的 "Hello World"。
## 完整代码
```javascript
// server.js
const http = require('http');
const hostname… 3% Hello World - 控制器示例 curl http://localhost:8080/hello/World
# {"message":"Hello, World!","powered_by":"CodeIgniter 4"}
``` 2% 01-hello-world-spring-boot # Java Hello World — Spring Boot REST API
## 目标
用 Spring Boot 3 创建一个 RESTful Web 服务,返回 JSON 格式的 "Hello World"。
## 完整代码
```java
// HelloWorldApplication.java
package com.example.demo;
import org.sp… 2% Hello World # PHP Hello World 例程
## 目标
运行第一个 PHP 程序:输出 "Hello, World!" 并在浏览器中验证。
## 方式一:CLI 命令行
创建 `hello.php`:
```php
<?php
echo "Hello, World!\n";
echo "今天的日期是:" . date('Y-m-d') . "\n";
```
运行:
```bash
p… 2% Hello World - 控制器与路由 ```bash
curl http://localhost:8000/api/hello
# {"message":"Hello, Vibe!","framework":"Symfony","php_version":"8.3.0","timestamp":"2024-01-01T00:00:00+00:00"}
curl http://localhost:8000/api/hello/Worl… 2% HTTP 服务器入门 — Hello World + 文件读写 # Node.js HTTP 服务器入门
## 目标
使用 Node.js 内置 `http` 模块和 `fs` 模块,创建最简单的 Web 服务器,并实现文件读写演示。
## 完整代码
```javascript
// server.js
const http = require('http');
const fs = require('fs');
const path = require… 2% Hello World REST API # Spring Boot Hello World REST API
## 目标
创建一个最简单的 Spring Boot REST API,返回 "Hello, World!" JSON 响应。
## 完整代码
### 1. 主应用类 `DemoApplication.java`
```java
package com.example.demo;
import org.springfr… 1% Hello World - 博客首页 # Remix Hello World — 博客首页
## 目标
创建一个最简单的 Remix 博客首页,展示 loader 数据加载和页面渲染。
## 完整代码
### 路由文件 `app/routes/_index.tsx`
```tsx
import { json } from "@remix-run/node";
import { useLoaderData, Link } fr… 1%