mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	* Add ".es" to recognised JavaScript extensions * Add heuristic to differentiate Erlang from ECMAScript * Add test-case for .es heuristic
		
			
				
	
	
		
			36 lines
		
	
	
		
			782 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			782 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| import config from "../webpack.config";
 | |
| import webpackDevMiddleware from "webpack-dev-middleware";
 | |
| import webpackHot from "webpack-hot-middleware";
 | |
| import webpack from "webpack";
 | |
| import express from "express";
 | |
| 
 | |
| app.use(webpackDevMiddleware(compiler, {
 | |
| 	noInfo: false,
 | |
| 	quiet: false,
 | |
| 	publicPath: config.output.publicPath,
 | |
| 	hot: true,
 | |
| 	historyApiFallback: true
 | |
| }));
 | |
| 	
 | |
| app.get("/(:root).json", (req, resp) => {
 | |
| 	resp.send(indexer.index(req.params.root));
 | |
| });
 | |
| 
 | |
| export default function(){
 | |
| 	const server = http.createServer(app);
 | |
| 	
 | |
| 	server.listen(3000);
 | |
| 	
 | |
| 	const wss = new WebSocketServer({server});
 | |
| 	
 | |
| 	let id = 1;
 | |
| 	wss.on("connection", (ws) => {
 | |
| 		console.log("Hello", " world");
 | |
| 		let wsId = id++;
 | |
| 		sessions[wsId] = ws;
 | |
| 		ws.on("close", () => {
 | |
| 			delete sessions[wsId]
 | |
| 		});
 | |
| 	});
 | |
| };
 |