varius official platform source code.
Revisión | bbec3cbff0c957d29d16a4daf6ae34ed45080895 (tree) |
---|---|
Tiempo | 2023-03-21 07:59:30 |
Autor | NknightA <n.knight.pc0627@gmai...> |
Commiter | NknightA |
development Core program.
@@ -2,7 +2,6 @@ const http = require("http"); | ||
2 | 2 | const express = require("express"); |
3 | 3 | |
4 | 4 | const app = express(); |
5 | -const portNumber = 8000; | |
6 | 5 | |
7 | 6 | app.get( "/", (req, res) => { |
8 | 7 | res.status(200).send("otowakka"); |
@@ -12,6 +11,8 @@ app.get("/api",(req,res) => { | ||
12 | 11 | res.status(200).send({id:1, text:"aaaa"}); |
13 | 12 | }); |
14 | 13 | |
15 | -app.listen(portNumber); | |
16 | 14 | // コンソールにポート番号を表示 |
17 | -console.log(`PortNumber is ${portNumber}`); | |
15 | + | |
16 | +const server = app.listen(8000, function () { | |
17 | + console.log("Running on: " + server.address().port); | |
18 | +}) |