This file contains hidden or 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
require('@babel/register'); | |
require('@babel/core'); | |
const config = require('dotenv').config; | |
const http = require('http'); | |
const app = require('./../../src/index').default; | |
const server = http.createServer(app); | |
config(); | |
const port = parseInt(process.env.PORT, 10); |
This file contains hidden or 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
Show hidden characters
{ | |
"presets": ["@babel/preset-env"], | |
"plugins": ["@babel/plugin-transform-runtime"] | |
} |
This file contains hidden or 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
PORT=5000 | |
DB_USER= | |
DB_HOST= | |
DB_NAME= | |
DB_PASSWORD= | |
SECRET=randomstring |
This file contains hidden or 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
const http = require('http'); | |
const config = require('dotenv').config; | |
const app = require('../../dist/index.js').default; | |
const server = http.createServer(app); | |
config(); | |
const port = parseInt(process.env.PORT, 10); | |
server.listen(port, () => console.log('Listening on port', port)); |
This file contains hidden or 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
"scripts": { | |
"start": "node src/bin/www", | |
"devstart": "babel-watch src/bin/dev", | |
"build": "rm -rf dist && mkdir dist && babel src -s -d dist", | |
"test": "echo \"Error: no test specified\" && exit 1" | |
} |
This file contains hidden or 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
import express from 'express'; | |
import { config } from 'dotenv'; | |
import routes from './routes'; | |
config(); | |
const app = express(); | |
app.use(routes); | |
app.use((req, res, next) => { |
This file contains hidden or 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
{ | |
"name": "nodeAPI", | |
"version": "1.0.0", | |
"description": "A node API covering postgres database, creating model with sequelize and authentication with jwt.", | |
"main": "index.js", | |
"scripts": { | |
"build": "rm -rf dist && mkdir dist && babel src -s -d dist", | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"repository": { |
This file contains hidden or 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
<!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>Document</title> | |
</head> | |
<body> | |
<div id="root"> |
This file contains hidden or 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
{ | |
"extends": ["airbnb"], | |
"env": { | |
"browser": true, | |
"node": true, | |
"jest": true, | |
"commonjs": true | |
}, | |
"rules": { | |
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }] |
This file contains hidden or 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
import React from 'react'; | |
const App = () => { | |
return ( | |
<div> | |
<h1>You just setup react with babel and eslint</h1> | |
</div> | |
); | |
}; | |