nodejs
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
nodejs [2022/01/20 01:34] – updated with image peteyboy | nodejs [2022/01/21 01:28] (current) – deleting, I renamed peteyboy | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | == Setting up a simple Node.js Server == | ||
- | You can try Node.js by using your [[meta_port_allocation|Port Allocation]] on the [[metaarray|The MetaArray]] to run your own Node.js server. What follows is a bare-bones ' | ||
- | - go to a project folder in your user folder, say < | ||
- | - use your favorite editor to open a new file called '' | ||
- | *paste the following code into the file: < | ||
- | // | ||
- | const hostname = ' | ||
- | // | ||
- | const port = 32056; | ||
- | |||
- | const server = http.createServer((req, | ||
- | | ||
- | | ||
- | | ||
- | }); | ||
- | |||
- | server.listen(port, | ||
- | console.log(`Server running at http:// | ||
- | });</ | ||
- | - run the server with '' | ||
- | - check it out with a browser pointed to your metaarray website but at your UID port, for example '' | ||
- | * it should look like {{: | ||
- | - quit the server with '' |