Commit 0dbb4769 authored by Yoon, Daeki's avatar Yoon, Daeki 😅
Browse files

express

parent 222934fc
node_modules
\ No newline at end of file
This diff is collapsed.
{
"name": "git-example",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://compmath.korea.ac.kr/gitlab/students/git-example.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.18.2"
}
}
import express from "express";
const port = 3000;
const app = express();
app.get("/api/hello", (req, res) => {
console.log("baseUrl", req.baseUrl, "hostname", req.hostname, "url", req.url);
console.log("root path get method called.");
res.send("<h1>안녕하세요.</h1>");
// res.json({ message: "안녕", id: 12 });
});
app.listen(port, () => {
console.log(`server is running at ${port} port.`);
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment