Skip to content

Instantly share code, notes, and snippets.

Trần Văn Luận luandevpro

  • Viet Nam
Block or report user

Report or block luandevpro

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View index.js
const express = require('express');
const next = require('next');
require('dotenv').config();
const dev = process.env.NODE_ENV !== 'production';
const app = next({ dev });
const handle = app.getRequestHandler();
app
.prepare()
View .eslintrc.js
module.exports = {
parser: 'babel-eslint',
extends: ['airbnb', 'plugin:prettier/recommended'],
env: {
browser: true,
jest: true,
},
plugins: ['react', 'jsx-a11y', 'import', 'prettier'],
rules: {
"camelcase": [2, {"properties": "never"}],
View index.js
import PropTypes from 'prop-types';
const Index = () => {
return (
<div style={{ textAlign: 'center', margin: '100px' }}>
<h1>hello</h1>
</div>
);
};
View package.json
{
"name": "nextjs-ssr",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"dev": "node index",
"build": "next build",
"start": "NODE_ENV=production node index.js",
"lint": "eslint components pages lib"
},
View handler.js
'use strict';
module.exports.hello = async (event, context, callback) => {
let request;
try {
request = JSON.parse(event.body);
} catch (e) {
return callback(null, {statusCode: 400, body: "cannot parse hasura event"});
}
const response = {
View serverless.yml
service: express-serverless
provider:
name: aws
runtime: nodejs10.x
stage: dev
region: us-east-1
functions:
hello:
View Animated.js
import React, { useState } from 'react';
import {
View, Text, Animated, StyleSheet, TouchableWithoutFeedback, ScrollView,
} from 'react-native';
import PropTypes from 'prop-types';
export default function Home() {
const [animated, setAnimated] = useState(new Animated.Value(0));
const animatedEvent = {
View Animated.js
import React, { useState } from 'react';
import {
View, Text, Animated, StyleSheet, TouchableWithoutFeedback, ScrollView,
} from 'react-native';
import PropTypes from 'prop-types';
export default function Home() {
const [animated, setAnimated] = useState(new Animated.Value(0));
const animatedEvent = {
View Animated.js
import React, { useState } from 'react';
import {
View, Text, Animated, StyleSheet, TouchableWithoutFeedback, Easing,
} from 'react-native';
import PropTypes from 'prop-types';
export default function Home() {
const [animated, setAnimated] = useState(new Animated.Value(150));
const animatedSpring = {
You can’t perform that action at this time.