Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
56 changes: 0 additions & 56 deletions README.md

This file was deleted.

29 changes: 29 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "interview-codingchallenge-fsjs",
"version": "1.0.0",
"description": "Hey, welcome to the first coding challenge of your interview process, you'll be presented with a set of steps to accomplish in order to get yourself graded on",
"main": "index.js",
"directories": {
"test": "test"
},
"scripts": {
"start": "nodemon src/index"
},
"repository": {
"type": "git",
"url": "git+https://github.com/luism3861/interview-codingchallenge-fsjs.git"
},
"author": "luismedina",
"license": "ISC",
"bugs": {
"url": "https://github.com/luism3861/interview-codingchallenge-fsjs/issues"
},
"homepage": "https://github.com/luism3861/interview-codingchallenge-fsjs#readme",
"dependencies": {
"express": "^4.16.4",
"morgan": "^1.9.1"
},
"devDependencies": {
"nodemon": "^1.18.9"
}
}
File renamed without changes.
22 changes: 22 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const express = require ('express');
const app = express();
const path = require('path');
const morgan = require('morgan');


app.set('port',process.env.PORT || 3000);


app.use(morgan('dev'));
app.use(express.json())


app.use('/api/tasks',require('./routes/task.routes'));


app.use(express.static(path.join(__dirname,'public')))


app.listen(app.get('port'),()=>{
console.log(`Server on port ${app.get('port')}`);
})
File renamed without changes.
16 changes: 16 additions & 0 deletions src/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>MERN STACK CRUD</title>
</head>
<body>


<div id="app"></div>


</body>
</html>
11 changes: 11 additions & 0 deletions src/routes/task.routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const express = require('express');
const router = express.Router();


router.get('/',(req,res)=>{
res.json({
status:'api works'
});
});

module.exports = router;
Empty file removed test/.gitkeep
Empty file.
Loading