Skip to content

Commit

Permalink
Fin seccion 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Fianax committed Sep 26, 2021
0 parents commit 1fbf86e
Show file tree
Hide file tree
Showing 10 changed files with 637 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PORT=3000
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
Binary file added .vs/01-pokemonList-Sockets-Server/v16/.suo
Binary file not shown.
3 changes: 3 additions & 0 deletions .vs/ProjectSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"CurrentProjectSetting": null
}
Binary file added .vs/slnx.sqlite
Binary file not shown.
27 changes: 27 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const express = require('express');
const path = require('path');
require('dotenv').config();

//App de Express
const app = express();

//Node server
const server = require('http').createServer(app);
module.exports.io = require('socket.io')(server);
require('./sockets/socket');


//Path publico
const publicPath = path.resolve(__dirname, 'public');
app.use(express.static(publicPath));




server.listen(process.env.PORT, (err) => {

if (err) throw new Error(err);

console.log('Servidor corriendo en el puerto', process.env.PORT);

});
Loading

0 comments on commit 1fbf86e

Please sign in to comment.