Browse Source

创建HTML服务并修正导航链接

- 创建Node.js HTML服务器,端口改为8080
- 添加首页index.html导航页面
- 重命名DeepSeek页面文件:renfang.html和canjiren.html
- 删除空的HTML文件
- 修正导航链接文字:人才小程序
- 添加dev脚本到package.json

🤖 Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
yourname 1 week ago
parent
commit
af486257bd
7 changed files with 123 additions and 2 deletions
  1. 0 0
      canjiren.html
  2. 66 0
      index.html
  3. 14 0
      package.json
  4. 0 0
      rencai.html
  5. 0 0
      renfang.html
  6. 43 0
      server.js
  7. 0 2
      yongren.html

+ 0 - 0
deepseek_html_20251130_c6c2d5.html → canjiren.html


+ 66 - 0
index.html

@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>小程序导航页面</title>
+    <style>
+        body {
+            font-family: Arial, sans-serif;
+            max-width: 800px;
+            margin: 0 auto;
+            padding: 20px;
+            background-color: #f5f5f5;
+        }
+        .header {
+            text-align: center;
+            margin-bottom: 40px;
+        }
+        .link-container {
+            display: flex;
+            flex-direction: column;
+            gap: 20px;
+        }
+        .link-card {
+            background: white;
+            padding: 20px;
+            border-radius: 8px;
+            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
+            text-decoration: none;
+            color: #333;
+            transition: transform 0.2s;
+        }
+        .link-card:hover {
+            transform: translateY(-2px);
+            box-shadow: 0 4px 8px rgba(0,0,0,0.15);
+        }
+        .link-title {
+            font-size: 18px;
+            font-weight: bold;
+            margin-bottom: 8px;
+        }
+        .link-description {
+            color: #666;
+            font-size: 14px;
+        }
+    </style>
+</head>
+<body>
+    <div class="header">
+        <h1>小程序导航</h1>
+        <p>选择您需要访问的小程序页面</p>
+    </div>
+
+    <div class="link-container">
+        <a href="/renfang.html" class="link-card">
+            <div class="link-title">人才小程序</div>
+            <div class="link-description">访问人才小程序页面</div>
+        </a>
+
+        <a href="/canjiren.html" class="link-card">
+            <div class="link-title">残疾人才小程序</div>
+            <div class="link-description">访问残疾人才小程序页面</div>
+        </a>
+    </div>
+</body>
+</html>

+ 14 - 0
package.json

@@ -0,0 +1,14 @@
+{
+  "name": "188-177-template-6",
+  "version": "1.0.0",
+  "description": "",
+  "main": "index.js",
+  "scripts": {
+    "start": "node server.js",
+    "dev": "node server.js",
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "keywords": [],
+  "author": "",
+  "license": "ISC"
+}

+ 0 - 0
rencai.html


+ 0 - 0
deepseek_html_20251130_7bedce.html → renfang.html


+ 43 - 0
server.js

@@ -0,0 +1,43 @@
+const http = require('http');
+const fs = require('fs');
+const path = require('path');
+
+const server = http.createServer((req, res) => {
+  let filePath = req.url === '/' ? '/index.html' : req.url;
+  filePath = path.join(__dirname, filePath);
+
+  const extname = path.extname(filePath);
+  let contentType = 'text/html';
+
+  switch (extname) {
+    case '.js':
+      contentType = 'text/javascript';
+      break;
+    case '.css':
+      contentType = 'text/css';
+      break;
+    case '.json':
+      contentType = 'application/json';
+      break;
+  }
+
+  fs.readFile(filePath, (err, content) => {
+    if (err) {
+      if (err.code === 'ENOENT') {
+        res.writeHead(404);
+        res.end('文件未找到');
+      } else {
+        res.writeHead(500);
+        res.end('服务器错误');
+      }
+    } else {
+      res.writeHead(200, { 'Content-Type': contentType });
+      res.end(content, 'utf-8');
+    }
+  });
+});
+
+const PORT = 8080;
+server.listen(PORT, () => {
+  console.log(`服务器运行在 http://localhost:${PORT}`);
+});

+ 0 - 2
yongren.html

@@ -1,2 +0,0 @@
-
-