Permalink
Browse files

Step 1. Node JS

  • Loading branch information...
alexeybondarenko committed Aug 5, 2017
0 parents commit 25281f6cfe61c79bc2192fcb4e8880ea03be9517
Showing with 50 additions and 0 deletions.
  1. +3 −0 .gitignore
  2. +2 −0 README.md
  3. +16 −0 package.json
  4. +21 −0 server/index.js
  5. +8 −0 server/views/index.ejs
@@ -0,0 +1,3 @@
node_modules
**/.*/
**/*.log*
@@ -0,0 +1,2 @@
# midi-api
MIDI API tutorials
@@ -0,0 +1,16 @@
{
"name": "midi-api",
"version": "1.0.0",
"description": "",
"main": "server/index.js",
"scripts": {
"start": "node server/index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"ejs": "^2.5.7",
"express": "^4.15.3"
}
}
@@ -0,0 +1,21 @@
const Express = require('express');
const ejs = require('ejs');
const path = require('path');
const app = new Express();
app.set('PORT', process.env.PORT || 3000);
app.set('view engine', 'ejs');
app.set('views', path.join(__dirname, './views'));
app.get('/', (request, response) => {
response.render('index');
});
app.listen(app.get('PORT'), (error) => {
if (error) {
console.log('Server started with an error', error);
process.exit(1);
}
console.log(`Server started and is listening at http://localhost:${app.get('PORT')}`);
})
@@ -0,0 +1,8 @@
<html>
<head>
<title>MIDI API tutorials</title>
</head>
<body>
<h1>MIDI API. Hello!</h1>
</body>
</html>

0 comments on commit 25281f6

Please sign in to comment.