forked from freeCodeCamp/boilerplate-project-filemetadata
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat/remove user stories+update repo (freeCodeCamp#9)
* feat: remove .gitconfig * feat: remove hyperdev assets * feat: add .gitignore * feat: add sample.env * feat: remove user stories from readme * feat: update packages and add dotenv * fix: update server.js * fix: port variable * fix: remove user stories from index + add favicon * fix: replace tabs with spaces * fix: css spacing + remove unused css
- Loading branch information
Showing
10 changed files
with
65 additions
and
217 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.env | ||
node_modules |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1 @@ | ||
|
||
# API Project: File Metadata Microservice for freeCodeCamp | ||
[![Run on Repl.it](https://repl.it/badge/github/freeCodeCamp/boilerplate-project-filemetadata)](https://repl.it/github/freeCodeCamp/boilerplate-project-filemetadata) | ||
### User stories: | ||
1. I can submit a form that includes a file upload. | ||
2. The form file input field has the `name` attribute set to `upfile`. | ||
3. When I submit something, I will receive the file `name`, `type`, and `size` in bytes within the JSON response. | ||
|
||
### Usage : | ||
* Go to the main page, and upload a file using the provided form. | ||
|
||
### Hint: | ||
* To handle the file uploading you should use the [multer](https://www.npmjs.com/package/multer) npm package. | ||
# [File Metadata Microservice](https://www.freecodecamp.org/learn/apis-and-microservices/apis-and-microservices-projects/file-metadata-microservice) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
{ | ||
"name": "file_metadata", | ||
"version": "0.0.1", | ||
"description": "API project for freeCodeCamp", | ||
"main": "server.js", | ||
"scripts": { | ||
"start": "node server.js" | ||
}, | ||
"dependencies": { | ||
"express": "^5.0.0-alpha.2", | ||
"cors": "^2.8.1" | ||
}, | ||
"engines": { | ||
"node": "4.4.5" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://hyperdev.com/#!/project/welcome-project" | ||
}, | ||
"keywords": [ | ||
"node", | ||
"hyperdev", | ||
"express" | ||
], | ||
"license": "MIT" | ||
"name": "file_metadata", | ||
"version": "0.0.1", | ||
"description": "API project for freeCodeCamp", | ||
"main": "server.js", | ||
"scripts": { | ||
"start": "node server.js" | ||
}, | ||
"dependencies": { | ||
"dotenv": "^8.2.0", | ||
"express": "^4.16.4", | ||
"cors": "^2.8.5" | ||
}, | ||
"engines": { | ||
"node": "12.0.0" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/freeCodeCamp/boilerplate-project-filemetadata" | ||
}, | ||
"keywords": [ | ||
"node", | ||
"express" | ||
], | ||
"license": "MIT" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PORT=3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
'use strict'; | ||
|
||
var express = require('express'); | ||
var cors = require('cors'); | ||
|
||
// require and use "multer"... | ||
require('dotenv').config() | ||
|
||
var app = express(); | ||
|
||
app.use(cors()); | ||
app.use('/public', express.static(process.cwd() + '/public')); | ||
|
||
app.get('/', function (req, res) { | ||
res.sendFile(process.cwd() + '/views/index.html'); | ||
}); | ||
|
||
app.get('/hello', function(req, res){ | ||
res.json({greetings: "Hello, API"}); | ||
res.sendFile(process.cwd() + '/views/index.html'); | ||
}); | ||
|
||
app.listen(process.env.PORT || 3000, function () { | ||
console.log('Node.js listening ...'); | ||
|
||
|
||
|
||
const port = process.env.PORT || 3000; | ||
app.listen(port, function () { | ||
console.log('Your app is listening on port ' + port) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters