Scaffolding and linting
This commit is contained in:
parent
8ec24d1733
commit
f19df338ca
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
node_modules
|
||||
.env
|
18
index.js
18
index.js
@ -2,29 +2,29 @@
|
||||
// where your node app starts
|
||||
|
||||
// init project
|
||||
require('dotenv').config();
|
||||
var express = require('express');
|
||||
require("dotenv").config();
|
||||
var express = require("express");
|
||||
var app = express();
|
||||
|
||||
// enable CORS (https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)
|
||||
// so that your API is remotely testable by FCC
|
||||
var cors = require('cors');
|
||||
var cors = require("cors");
|
||||
app.use(cors({ optionsSuccessStatus: 200 })); // some legacy browsers choke on 204
|
||||
|
||||
// http://expressjs.com/en/starter/static-files.html
|
||||
app.use(express.static('public'));
|
||||
app.use(express.static("public"));
|
||||
|
||||
// http://expressjs.com/en/starter/basic-routing.html
|
||||
app.get('/', function (req, res) {
|
||||
res.sendFile(__dirname + '/views/index.html');
|
||||
app.get("/", function (req, res) {
|
||||
res.sendFile(__dirname + "/views/index.html");
|
||||
});
|
||||
|
||||
// your first API endpoint...
|
||||
app.get('/api/hello', function (req, res) {
|
||||
res.json({ greeting: 'hello API' });
|
||||
app.get("/api/hello", function (req, res) {
|
||||
res.json({ greeting: "hello API" });
|
||||
});
|
||||
|
||||
// listen for requests :)
|
||||
var listener = app.listen(process.env.PORT || 3000, function () {
|
||||
console.log('Your app is listening on port ' + listener.address().port);
|
||||
console.log("Your app is listening on port " + listener.address().port);
|
||||
});
|
||||
|
12
package.json
12
package.json
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "request-header-parser-microservice",
|
||||
"name": "@radii-fcc-backend/request-header-parser-microservice",
|
||||
"version": "0.0.2",
|
||||
"description": "API project for freeCodeCamp",
|
||||
"main": "index.js",
|
||||
@ -13,17 +13,17 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/freeCodeCamp/boilerplate-project-headerparser.git"
|
||||
"url": "https://radii.dev/freeCodeCamp.org-Back-End-Dev-and-APIs/headerparser.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/freeCodeCamp/freeCodeCamp/issues"
|
||||
"url": "https://radii.dev/freeCodeCamp.org-Back-End-Dev-and-APIs/headerparser/issues"
|
||||
},
|
||||
"homepage": "https://github.com/freeCodeCamp/boilerplate-project-headerparser#readme",
|
||||
"author": "freeCodeCamp <team@freecodecamp.org>",
|
||||
"homepage": "https://fcc_backend_headerparser.radii.page/",
|
||||
"author": "Radii <fcc@radii.dev>",
|
||||
"keywords": [
|
||||
"freeCodeCamp",
|
||||
"node",
|
||||
"express"
|
||||
],
|
||||
"license": "MIT"
|
||||
"license": "AGPL-3.0-or-later"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user