Skip to content

Commit

Permalink
cleaning up directory structure, removing ejs
Browse files Browse the repository at this point in the history
Signed-off-by: Flynn Joffray <flynn@balena.io>
Change-type: major
  • Loading branch information
nucleardreamer committed Jun 3, 2022
1 parent 97e4858 commit 75dd916
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 116 deletions.
110 changes: 1 addition & 109 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simple-server-node",
"version": "1.1.0",
"version": "2.0.0",
"description": "A simple Expressjs Web server on balena",
"main": "server.js",
"private": true,
Expand All @@ -23,7 +23,6 @@
},
"homepage": "https://github.com/balena-io-projects/simple-server-node#readme",
"dependencies": {
"ejs": "~3.1.6",
"express": "~4.17.1",
"serve-favicon": "~2.5.0"
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
9 changes: 4 additions & 5 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@ const favicon = require('serve-favicon')
const app = express()
const PORT = 80

app.use(favicon(join(__dirname, '..', 'views', 'public', 'favicon.ico')))
app.set('views', join(__dirname, '..', 'views'))
app.engine('html', require('ejs').renderFile)
app.use(favicon(join(__dirname, '..', 'public', 'favicon.ico')))
app.set('views', join(__dirname, '..', 'public'))
app.set('view engine', 'html')

// Enable the public directory for resource files
app.use('/public', express.static(
join(__dirname, '../views/public')
join(__dirname, '..', 'public')
))

// reply to request with the hello world html file
app.get('/', function (req, res) {
res.render('index')
res.sendFile(join(__dirname, '..', 'public', 'index.html'))
})

// start a server on port 80 and log its start to our console
Expand Down

0 comments on commit 75dd916

Please sign in to comment.