Skip to content

💬 Developer console is not useless in production anymore, it's a chat

Notifications You must be signed in to change notification settings

surdu/console.say

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

console.say

A simple chat for your developer tools / firebug console. The server of the chat is written for node.js.

Server

First, you need to install the console.say node.js package with the following command:

npm install console.say

Then you need to bind console.say to yout http server like so:

require('console.say').bind(http);

So, your server code should look something like this:

var app = require('express')();
var http = require('http').Server(app);

// serving the client page
app.get('/', function(req, res){
  res.sendfile('index.html');
});

http.listen(3000, function(){
  console.log('listening on *:3000');
});

require('console.say').bind(http);

Client

On the client page you will need to add the following two lines:

<script src="/socket.io/socket.io.js"></script>
<script src="/console.say/client.js"></script>

As you can see, both socket.io and console.say serve their own client scripts.

In the server example above, we serve to the client a file called index.html.

The content of index.html is the following:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>console.say</title>
  </head>
  <body>
    <h1>Hey!</h1>
    <p>All the magic is in the console. Press CTRL+Shift+i on PC or CMD+ALT+i on Mac to open the console.</p>
    <script src="/socket.io/socket.io.js"></script>
    <script src="/console.say/client.js"></script>
  </body>
</html>

N-joy 😉

About

💬 Developer console is not useless in production anymore, it's a chat

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published