Express: Difference between revisions
Jump to navigation
Jump to search
(Created page with "<source lang="bash"> npm adduser --registry=https://cdn.chorke.org/nexus/repository/npm/ : <<'EOF' npm notice Log in on https://cdn.chorke.org/nexus/repository/npm/ Username:...") |
No edit summary |
||
Line 17: | Line 17: | ||
const express = require('express'); | const express = require('express'); | ||
const app = express(); | const app = express(); | ||
const PORT = | const PORT = 2013; | ||
app.get('/', (req, res) => res.send('Express + TypeScript Server')); | app.get('/', (req, res) => res.send('Express + TypeScript Server')); | ||
app.listen(PORT, () => { | app.listen(PORT, () => { | ||
Line 27: | Line 27: | ||
</source> | </source> | ||
http://localhost: | http://localhost:2013/ | ||
Revision as of 06:56, 25 January 2021
npm adduser --registry=https://cdn.chorke.org/nexus/repository/npm/
: <<'EOF'
npm notice Log in on https://cdn.chorke.org/nexus/repository/npm/
Username: (academia)
Password: (<default hidden>)
Email: (this IS public) ([email protected])
Logged in as academia on https://cdn.chorke.org/nexus/repository/npm/.
EOF
mkdir -p ~/Documents/express_ws/express-micro-service/
cd ~/Documents/express_ws/express-micro-service/
npm init --yes
vim package.json
cat <<-'EOF' >> ./index.js
const express = require('express');
const app = express();
const PORT = 2013;
app.get('/', (req, res) => res.send('Express + TypeScript Server'));
app.listen(PORT, () => {
console.log(`[server]: Server is running at http://localhost:${PORT}`);
});
EOF
node index.js
http://localhost:2013/