Express: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
Line 33: Line 33:
* [https://blog.logrocket.com/typescript-with-node-js-and-express/ Using TypeScript with Node.js and Express]
* [https://blog.logrocket.com/typescript-with-node-js-and-express/ Using TypeScript with Node.js and Express]
* [https://stackoverflow.com/questions/31645341/ suppress variable substitution in bash]
* [https://stackoverflow.com/questions/31645341/ suppress variable substitution in bash]
* [https://help.sonatype.com/repomanager3/formats/npm-registry Nexus3 NPM Registry]

Revision as of 06:58, 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/


References