Scaffolding and linting

This commit is contained in:
Manish 2023-03-28 02:57:53 +11:00
parent 8ec24d1733
commit f19df338ca
3 changed files with 16 additions and 15 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
node_modules
.env

View File

@ -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);
});

View File

@ -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"
}