Express

From Chorke Wiki
Revision as of 06:58, 25 January 2021 by Shahed (talk | contribs) (→‎References)
Jump to navigation Jump to search
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/


References